-
String manipulation
I'm having an issue concerning the functions *strtok and strlen.
I assumed these were the proper functions for separating words and determining their length, but since strlen cannot be used on tokens as if they were strings, I found this procedure impossible.
There must be a possible way to apply strlen to these separate words. If anyone knows a way, please let me know.
-
you could parse the string for spaces and save the parts in more strings, then do a strlen on them
-
The code below is my attempt to analyze a string's words (stored in the array "words") and determine which is the largest word. My problem is that I get a compiling error stating that the ">" sign in the if statement is a "signed/unsigned mismatch". What does this mean and how can I fix it?
for ( int k = 0; k < wcount; k++)
{
if ( strlen(words[k]) > bignum)
{
bignum = strlen(words[k]);
bigword = k;
}
}