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



Thanks for all the responses.
Start being assigned to 0 in the loop was very stupid and due to late
night brain fever, it is supposed to be start = i in the loop. Yes I
wanted ||, not |, although doesn't | do the same thing in this case?
Anyway, I've fixed these two, and I'm still getting the same error.
Yes I know the duplication is ugly. I wanted to get a naive
implementation working and then factor it out, but the 'naive' version
is turning out harder than I thought.
The reason istax is a seperate function is because the definition of
token delimiters is likely to change, so I wanted it to be in one place
(and yes, I know I don't use it in counttokens. counttokens came first
and I forgot to factor it out)
As to the many non-standard c things I've done, thanks for pointing
them out. I've been spoilt by a very forgiving compiler (gcc,
presumably doing c++ on the side) which just isn't shouting at me about
it. I'm going to fix all these mistakes, and repost the code.
Thanks peter for the working code. I'll probably end up using that as
it's much neater than what I've been doing, but I'd like to get mine
working so I understand what's wrong with it.

.



Relevant Pages

  • Re: generate list in increments of 10s
    ... I'd probably use a while loop with a less-than comparison and a simple ... I'll offer working code in return. ... Its ok if its homework, then they will remain stupid for lack of effort and laziness will haunt their every clueless waking moments:) ...
    (perl.beginners)
  • Re: Size of a remote URL
    ... Your working code uses this URL: ... Your broken code uses this URL: ... It doesn't matter whether it's inside a loop or outside a loop. ...
    (comp.lang.python)
  • Re: Chipcon/8051 sanity check
    ... This assembly code does not do x = c; ... Both the working and non working code increment c. ... otherwise it is optimised away and the loop does nothing. ... An IEC 61508 compliant real time kernel for safety related systems. ...
    (comp.arch.embedded)
  • Re: store whole InputStream in a String
    ... You improved working code with an infinite ... > loop. ... >> Try to focus on the topic, not an irrelevant digression. ...
    (comp.lang.java.programmer)