How to copy one char* array to another.
Dec 29, 2009 at 4:42pm UTC
I write function but can not copy one array to second. If is one alert work good, but if are two alerts program is stoped witch error.
I want to copy text to value *t on end function.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
void returnTEXT(char ** t){
// methot return set *t="\0"
char tempText[2] = "\0" ;
this ->returnAlert01(&t);
if (*t != "\0" )
strcat(tempText, *t);
// methot return set *t="\0"
this ->returnAlert02(&t);
if (*t != "\0" )
strcat(tempText, *t);
std::cout << tempText << " " << strlen(tempText) << std::endl;
}
Last edited on Dec 30, 2009 at 3:24pm UTC
Dec 29, 2009 at 6:40pm UTC
if (*t != "\0" )
should be
if (*t != 0)
or
if (*t != NULL)
Topic archived. No new replies allowed.