i'm trying use strcat function manipulate strings in linux throws me error. have no idea why.. here code
int yx = 1234; char yx2[100]; sprintf(yx2, "%d", yx); //converting int str char str[5] = {1,2,3,4,5}; strcat(yx2, str[4]); //snprintf(yx2, sizeof(yx2), "%s%s", str[4]) <- 1 won't work neither
the system crash after this...
both arguments of strcat
should pointer null terminated char
strings (char *
type). str[4]
of char
type.
Comments
Post a Comment