Hi guys,
I am trying to do a simple, CLi ftp client/server c++ application.
On the client end, once started, the command prompt will be:
ftp>>
just like a regular command line software.
At one point, I am suppose to let use key in the following to transfer file:
Quote:
put fileFromClient fileToServer
|
basically the above command will just copy a file from client to server.
I achieve that by issuing the following commands:
Where a and b are appropriate variables.
My question is, how can I validate the input, such that, if a user enters only 'put' or 'put fileFromClient' (
basically not full commands which consist of the 3 arguements), I can capture it and prompt the user?
Right now, by concatenating cin, the software will keep waiting, such that if I type 'put', hit the return key, the application will appear to be waiting (for the next 2 input).
How can I capture the errornous user input from the moment the user hit the return key? and not let the program wait for the next 3 inputs from user, differentiate by the return key?
I tried using cin.good() but i think I am not getting it right...
anyone? thanks!
ps: this is for a school assignment, but I'm just asking about how can I validate concatenated inputs... not asking help for my work hehe - in case you're wondering