I just can't figure out strcat.
- by Anonymous
I know I shouldn't be using that function, and I don't care. Last time I checked the spec for strcat, it said something along the lines of updating the first value as well as returning the same.
Now, this is a really stupid question, and I want you to explain it like you're talking to a really stupid person.
Why won't this work?
char* foo="foo";
printf(strcat(foo,"bar"));
EDIT: I don't know the difference between char[] and char*. How would I allocate a string of 255 characters?
EDIT 2: OK, OK, so char[number] allocates a string of that many bytes? Makes sense. Thanks.