My exercise is to create 3 arrays of 6 field each and store a value in them. After that they need to be placed into a 30 field array with the use of "strcat" and the result needs to be printed to the screen 10 times.
I replaced the "PAUSE" with getchar() as I was advised to in my previous topic, Could someone look this over for me and comment on it if something should be changed or if it is good the way it is written?
Code:
#include<stdio.h>
#include<string.h>
int main(void)
{
char firstValue[6];
char secondValue[6];
char thirthValue[6];
char mixed[30];
int counter;
strcpy(firstValue, "James");
strcpy(secondValue, "Hornet");
strcpy(thirthValue, "Watson");
strcpy(mixed, firstValue);
strcat(mixed, " ");
strcat(mixed, secondValue);
strcat(mixed, " ");
strcat(mixed, thirthValue);
for(counter = 0; counter < 10; counter ++)
printf("%s\n", mixed);
getchar();
return 0;
}