The question is why should I define size of string (string[]
should be string[some-number]
)
When the program is as following it gives me Abort tr
The first parameter of strcat
is used to store the result, so it must have enough space for the concatenated string.
In your code:
char buffer1[] = "computer";
is equivalent to:
char buffer1[9] = "computer";
defines a char array with just enough space for the string "computer"
, but not enough space for the result.