Ive recently been working on a C++ project where we are required to prompt the user for a string "command", take the first char from that string to decide exactly what command it is, and then take the remaining parts of that string and turn them into individual characters and integers... Im really unsure how to go about doing this... An example for a command would be something like:
With this, i would need to read the string and take the first character X(which could be a number of different letters, each corresponding to a different function to do) and then read each of the numbers into seperate integers such as:
w = 04
x = 03
y = 08
z = 12
And then the final character into a seperate char value...
I know how to read one specific character into a char but the thing that gets me from this is being able to read 2 positions into the string into one int.... Such as read the 0 and 4 in positions 1 and 2 into int x for example...
Im not sure what commands to use to do this at all... any pointers would help.