Mega Code Archive

 
Categories / C++ / Data Type
 

How to use the strcat function

#include <stdio.h> #include <string.h> #define iSTRING_SIZE 35 main( ) {  char greeting[] = "Good morning",       name[] =" Joe, ",       message[iSTRING_SIZE];  strcpy(message,greeting);  strcat(message,name);  strcat(message,"how are you?");  printf("%s\n",message);  return(0); }