I have no idea why this happen to me, plz help.
In a method i have:
char p[255] = "";
char* p2;
char** temp;
for (i = 0 ...){
...
p = "abc" // when i = 0
= "222" // when i = 1
p2 = (char*)p;
p2 = &p2[loc];
temp=p2;
}
however, when I try to print out temp it gives me
abc222
222
instead of
abc
222
thx in advance
In a method i have:
char p[255] = "";
char* p2;
char** temp;
for (i = 0 ...){
...
p = "abc" // when i = 0
= "222" // when i = 1
p2 = (char*)p;
p2 = &p2[loc];
temp=p2;
}
however, when I try to print out temp it gives me
abc222
222
instead of
abc
222
thx in advance