Don't use strcat then. Or do use strcat! Either way, it'll be fine.
Not...
Code:
char buf[BUFSIZ] = {0}; /* <-- your string-to be */
int c; /* <-- The character you read. */
size_t s = 0; /* <-- The position in the array you're using. */
repeat until at the end of the file, or the string is full
{
read a character
if not whitespace
put into array at 's' space, increment 's'
else
ignore it, ie: do nothing with it, don't increment 's'
}
Or do...
Code:
char buf[BUFSIZ] = {0};
char cat[2] = {0};
int c;
repeat blah blah
read a character into 'cat[0]'
strcat cat onto buf
Quzah.