I assume that you are using some scanf function to scanf your input.
not to do. In this case, this will not work.
Instead, just read the input line, divide it with spaces into tokens (examples: "@ 0 4 1 2 @ 0 4" β "@", "0", "4", "1", "2", "@", "0", "4" and "64 0 5" β "64", "0", "5" ).
The next step is parsing. There you can snatch @ -s. It will be easy to distinguish them from 64 -s as strlen("@") == 1 and strlen("64") == 2 , you see;)
And when you come across a purely numeric string, you can use something like atoi to convert it to an integer (and after that you can convert it to unsigned char ).
source share