Re: I think I'm gonna cry. (or newby problems with simple string function)




tedu wrote:
> robbie.carlton@xxxxxxxxx wrote:
> > int i = 0;
> > int len = strlen(str);
> > char ch;
> > int start = 0;
> > int mode = 0;
> > int t = 0;
> > for (i = 0; i < len; i++) {
> > ch = str[i];
> > if (mode == 0) {
> > if(!isspace(ch)) {
> > mode = 1;
> > start = 0;
> > }
> > } else {
> > if(istax(ch)) {
> > ret[t] = extract(str + start, (i + 1) - start);
> > t++;
> > } else if(isspace(ch)) {
> > mode = 0;
> > ret[t] = extract(str + start, (i + 1) - start);
> > t++;
> > }
> > }
> > }
>
> you aren't reassigning start nor using t in a meaningful way.

er, sorry, t is ok. i still think you want to be doing something more
with start.

.