Re: Reading from the command line using stringstreams

From: Blake Kaplan (mrbkap_no_at_spam_rice.edu)
Date: 10/17/03


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


Relevant Pages

  • Re: Is There a Slicker Way?
    ... And I asked for clarification on that advice, but no clarification was forthcoming. ... AND dateadd(DAY, @Days, StartDate) ... I very much appreciate another example, especially if it will eliminate my loop. ...
    (microsoft.public.sqlserver.server)
  • Re: [PATCH] iSeries virtual disk
    ... >> I think that logic needs some clarification. ... - now to that loop in module_init: ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: SMTP Causes 100% CPU Usage
    ... for your input and help please bear with me if I ask for clarification on ... loop. ... The symptoms are constant connections resending the same e-mail (MAIL FROM, ...
    (microsoft.public.inetserver.iis.smtp_nntp)
  • Re: The condition variable test
    ... Advanced synchronisation programmers are used to the wait loop for the handling ... only because the spurious wakeups. ... they must comply to the condition variable test too. ... I would prefer further clarification from your view what can not be done by the ...
    (comp.programming.threads)