I have a problem in my code. I want to parse a char array to an char pointer; How can i do it?
Example code :
char tmp[1000];
char *temp;
gets(tmp);
How can i parse the char tmp into char *temp?
Regards,
I have a problem in my code. I want to parse a char array to an char pointer; How can i do it?
Example code :
char tmp[1000];
char *temp;
gets(tmp);
How can i parse the char tmp into char *temp?
Regards,
If you mean, to point temp
to tmp
, this should work.
char tmp[1000];
char *temp;
temp = &tmp[0];
If you want to copy, you may need to do some more work.