Advertisement
Advertisement
| 05.31.2008 at 11:14AM PDT, ID: 23447191 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: |
char *message; char * one = "hello"; message = realloc(message, (strlen(one) +1) * sizeof(char)); strcpy(message, one); char *two = "test"; //add the size of the second string to the size of the message message = realloc(message, ( (strlen(message) +1) + (strlen(two) +1) ) * sizeof(char); //add string two into message strcat(message, two); |