String append: Difference between revisions
Content added Content deleted
No edit summary |
|||
Line 60: | Line 60: | ||
int main() |
int main() |
||
{ |
{ |
||
char str[ |
char str[24]="Good Morning"; |
||
char *cstr=" to all"; |
char *cstr=" to all"; |
||
char *cstr2=" !!!"; |
char *cstr2=" !!!"; |
||
int x=0; |
int x=0; |
||
//failure when space allocated to str is insufficient. |
//failure when space allocated to str is insufficient. |
||
⚫ | |||
⚫ | |||
if(sizeof(str)>strlen(str)+strlen(cstr)+strlen(cstr2)) |
|||
⚫ | |||
{ |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
x=strlen(str); |
|||
⚫ | |||
⚫ | |||
} |
|||
return 0; |
return 0; |
||
}</lang> |
}</lang> |