Re: Reading from the command line using stringstreams
From: Blake Kaplan (mrbkap_no_at_spam_rice.edu)
Date: 10/17/03
- Next message: mp: "memcpy to struct with bitfields"
- Previous message: Blake Kaplan: "Re: Reading from the command line using stringstreams"
- In reply to: Blake Kaplan: "Re: Reading from the command line using stringstreams"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 16 Oct 2003 20:34:25 -0500
[a bit of clarification]
Blake Kaplan wrote:
> mark lawler wrote:
>
[...
> > CODE:
> >
> > string line;
> > string command;
> > string argument;
> > string empty;
> > stringstream str_stream(line);
>
> Why not move this into the while loop? This way you wouldn't have to
> manually set the string each time. Also, why not make this an
> istringstream? Do you actually need to stream /into/ it?
By this, I mean something along the lines of:
while (...)
{
getline(cin, line);
// ...
stringstream str_stream(line);
// ...
}
[...]
-- Blake "Before they had drawing boards, what did they go back to?" Remove "_nospam_" from my e-mail address to reply
- Next message: mp: "memcpy to struct with bitfields"
- Previous message: Blake Kaplan: "Re: Reading from the command line using stringstreams"
- In reply to: Blake Kaplan: "Re: Reading from the command line using stringstreams"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|