help me !!

Please help me with this problem ยป

" Write down a program which reads lines of
input from keyboard until you enter a blank line.
After reading the lines the program will tell how
many characters, words and sentences were there
in the input. "
thanks but it didn't help. can u suggest me anything with " Managing Console I/O operations " ?
> can u suggest me anything with " Managing Console I/O operations " ?

The only operation that is needed for the program is:
"read lines of input from keyboard until you enter a blank line"

To read a line of input, use std::getline() http://www.cplusplus.com/reference/string/string/getline/

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <iostream>
#include <string>

int main()
{
    std::string line ;

    // read line by line from stdin until a blank line is entered
    while( std::getline( std::cin, line ) && !line.empty() )
    {
        // process the line that was just read
        // count characters etc.
    }
}
thanks a ton :-)
Topic archived. No new replies allowed.