I have declared 3 pointers to char arrays (here is example code). Somehow, they all eventually end up with the same value. Function1 returns a char* with the value of "Hello".
char * char1;
char * char2;
char * char3;
output looks like this:
I checked and somehow, char2 and char3 had gotten the same values as char1 on the strcpy statement that changed char1's value to "Hello". How could this happen? Some loss of a null character? The word "Hello" was retrieved from a text file by Function1, if that could have something to do with it. Thanks.