I\'m using Microsoft Visual Studios to program a C language assignment. Basicall
ID: 3551916 • Letter: I
Question
I'm using Microsoft Visual Studios to program a C language assignment.
Basically, the user uses flags say the numbers 1001 and encapsulates a random string he types with the flags. Then the program prints out whatever was in between the flags out. So if abdf1001hotpocketsftw1001 then it should return hotpocketsftw.
The slightly complicated part is that the program has to read the string without the user hitting enter. My current idea is to use a while loop to continuously scan with getchar, and have an if statement to break out if a key like 'e' is pressed. Any help please? Even Pseudo code would be enough
Explanation / Answer
Code in C(tested) :
--------------------------------
And your logic about reading characters by getchar until something apart from number and alphabet is found is correct.
Note : You should increase some points. Anyways, feel free to ask for any further explanation :)