Why'd they use char str in the example???
What types can be used?
It sounds like you may be confused as to how an array/C-style string is passed to a function in C and C++. In the example, the array for a C-style string str is declared.
/* strcat example */
int main ()
strcpy (str,"these ");
strcat (str,"strings ");
strcat (str,"are ");
When the function strcat is called, it is passed str . Is this the point of confusion?
The array as passed not by value (meaning a copy of the entire array), but rather as a pointer to the first element of the array. The str in this case is a sort of 'shorthand' for &str , which is a char* -- as expected by strcat .