For concatenation, copying and comparison, couldn't you use strcat(), strcpy and strcmp()?
(Did you misspell?)
To chomp, why not do exactly what the strcpy function does, but instead of exitting when the null char is reached, exit the loop when the newline is reached and then stick a null char at the end of the copied string (it depends how you do it though).
Code:
while (*src != '\n')
* *dest++ = *src++;
*dest = '\0';
...and for the space thing, do you mean in 1 string contain all spaces or split text into strings delimited by spaces?
If it's one big string, I'm not sure...
If it's splitted, well I think you'd know how to do that....so yeah I don't know either.
Bookmarks