Olufowobi Lawal schrieb am Sa, 1.11.2008:

> Problem solved,
> Thanks everyone,thanks Ignacio.
> 
> Bingo! It now works! Your explanation on the
> 'for' made me understand it better.

You're welcome.  Nice to know I managed to explain
it clearly.

> for(i=0;((word[i]>='a')&&(word[i]<='z')||word[i]);i++)
> 
> with a break statement did the trick.

Ingenious trick.  I would have used:

#include <string.h>
// ...
strLength = strlen(word);
for (i=0; i<strLength; i++) { ... }

but this is of course a matter of personal taste
(or of being used to it), and by no means is it
better or worse than yours (although yours may be
regarded as better, since it doesn't require an
extra library).

Ignacio



      

Reply via email to