multiple tokens input to cin

S

sam++

Hi,

How can I use "cin" to take multiple arguements from user input?
The program will display a ">" shell-like command prompt and waiting for
user input one or more arguments in a commandline. So this is different
from a program take multiple arguments when initially start up the program.

Thanks
Sam
 
V

Val

| Hi,
|
| How can I use "cin" to take multiple arguements from user input?
| The program will display a ">" shell-like command prompt and waiting for
| user input one or more arguments in a commandline. So this is different
| from a program take multiple arguments when initially start up the program.
|
| Thanks
| Sam

string sInput;
while(std::cin>>sInput)
{
// sInput received token. Process it.
}
//No more input.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top