OneSadCookie Wrote:Text input is a huge minefield. Perhaps you should start by explaining what kind of thing you're making here (FPS? RTS? Typing Tutor? High-score name entry field?).

If the character you've received is ASCII, (char)character is a C char. That may or may not be useful to you.

Sure. I'm working on a text parser for an in-game console, similar in feel to the unix terminal. Basically you type in a line of text, and when you hit enter, the it gets parsed and executed by the console.

the problem is that if the first word read into"word" (which in the example is PLAYER) is longer than the second word(MOVE), the second word ends up being, in this case, "moveer" where the "er" are characters left over from "player" read in from the first call to read_word().

So, is there a way to restore word[] to it's totally null/empty state using only its pointer from within read_word()?