Hey guestgulkan,
thanks for your response, however - I am already using the strlen, however - I am trying to count to the next word.. I'm super novice at c++, so I dont know, if its at the end of the string, where the terminiating \0 is, or at the end of each word..
currently, I found an isspace and iscntrl function.. its closer, to what I'm looking for, but still getting the wrong numbers..
lets take a for instance, and continue with the string above.. str2, that contains "or not to be"
want to count "or" then the function to return 1, being the end of the word.. o is 0 index, and r is 1 index...
here is the code i have started. (please dont mind the variables, its the actual program I am working with for my class assignment)
1 2 3 4 5
|
while (!iscntrl (eng[ewidx]) || !isspace (eng[ewidx]) || eng[ewidx] == NULL)
{
ewidx++;
}
return ewidx;
|