--- In [email protected], "johnmatthews2000" <jm5...@...> wrote: > > for (n = 0, s = str; *s; s++) > if ((*s != ' ') && ((s == str) || (s[-1] == ' ')))
Using strtok():
for (n = 0, s = strtok(str, " "); s; s = strtok(NULL, " "))
(must also remove const qualifier from str[] and *s)
