Relative Content

Tag Archive for cparsingscanfuser-input

Parsing with a space (sscanf or strtok)

For some context, my game runs in the terminal and is like a command line type game. At the moment to process commands is does a strcmp() for every single command which isn’t really pretty nor efficient. Because of this, I decided I should redo it. I tried looking at other posts and didn’t find anything useful. What I’m looking for is for it to save each section of the command.
For example: