473,325 Members | 2,712 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

multiple tokens input to cin

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
Jul 23 '05 #1
2 2670
sam++ wrote:
How can I use "cin" to take multiple arguements from user input?
use 'getline' and parse it.
[..]

Jul 23 '05 #2
Val

"sam++" <sam++@--.com> wrote in message news:d3***********@news.hgc.com.hk...
| 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.
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Anand | last post by:
Suppose i have a big list and i want to take tke the first one and rest of the list like car/cdr in lisp. is there any easy way to do this in python? Only way i know is a = range(10) x, y =...
33
by: Geometer | last post by:
Hello, and good whatever daytime is at your place.. please can somebody tell me, what the standard behavior of strtok shall be, if it encounters two or more consecutive delimiters like in...
60
by: Shawnk | last post by:
Some Sr. colleges and I have had an on going discussion relative to when and if C# will ever support 'true' multiple inheritance. Relevant to this, I wanted to query the C# community (the...
2
by: childofthehorn | last post by:
Okay, so I can get this to read the first line of a txt document. I just can't figure out how to get it to read the next lines. I have to use "user_input" in a function. The wait function just waits...
2
by: max.giacometti | last post by:
Hi everybody! I am using lex and yacc to write a vhdl to systemc converter. Lex simply reads the input file and yacc implements grammar and translation. I'd like to be able to make yacc...
0
by: Camfa | last post by:
Hi all, I’ve been messing around with the following question for 2 days now, and i still haven’t find a fix. So i hope you can help me. I’ll quickly show you guys the situation: There are 2...
1
by: ecce66 | last post by:
i'm trying to make a very simple combo box which will act as a shopping cart for my website where i will be selling some art prints; ideally once a visitor selects a print title in the combo box,...
3
by: Ned White | last post by:
Hi All, To replace some substrings in a string value, i use Regex.Replace method mulptiple times like; strmemo = "new Data for user; Name:@@Name , Surname:@@Surname, Address:@@Address";...
0
by: jsimps44 | last post by:
Hi, I'm fairly new to c, and very new to piping and file descriptors and can't seem to get past this problem. The piping is very much not working, and I can't figure out for the life of me why. Any...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.