Are you tokenising characters or strings? Either way you are generating strings (char arrays), and therefore casting to int would give you the pointer value (I think - correct me if I'm wrong).

If you know that the token is going to be a single char then you could use:

int num = (int)token[0];

Perhaps..?

HD