Hi, I basically have a Token of type char *token written from a custom tokenizer.C and H file.

What i want to do is parse that into individual characters such has if that char *token is {4r$a$} i want a char arr {4, r, $, a, $}, rather than the entire line in 1 entry.

What i originally tried to do is (char*) &set.start (set.start is the char *token) but it does the exact opposite of what i want, skips up to i, then stores everything after that.

I need to run a substitution on the value between to $ and replace it with watever value it is...which has been a pain trying to figure out how to do it.. I did edit tok.c to try and skip the $ and set the type...but it just seg faults when i break or return the token from the case while loop, if it doesn't break/return, it just keeps running and sets the type as End Of Line >_>"

If needed i can post tok.c and h if u want, but all i really need is how to parse char *token.

Many thanks.

Edited by zhane3: n/a

7 Years
Discussion Span
Last Post by WaltP

You already have your input in individual characters. That's how a character array works.

With characters there is no such thing as 1 entry. It's always a character array.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.