How to require a user to press enter twice

Okay, so I don't really have any code for this specific problem just yet. Mostly because I don't even know where to get started despite various google searches. Essentially what I have to is have a user enter a paragraph and then analyze some aspects of the paragraph, however, what i'm having trouble with is that the user should have to press enter twice before the program begins to analyze the paragraph. I don't really know where to get started on this and any help would be greatly appreciated.
1
2
3
4
5
6
7
8
9
/* (...) */
#include <conio.h>

//.......
char ch('a');
for(unsigned int x = 0; x < 2; ((int(ch) == 13) ? x++ : x))
{
    ch = getch();
}


look up conio.h. It's a header file. What specifically do you need help with? Also, that code will get the key until enter is pressed twice.
Last edited on
Well it's a program that reads a paragraph and counts how many sentences are in it and how many times the word 'the' is used. I understand that part simple enough as it's simple enough. The only part that's tripping me up is that the user has to press the enter key twice in order to signal that s/he's done entering the paragraph.
Press ENTER twice to finish
http://www.cplusplus.com/forum/beginner/2409/#msg9254

[edit] You're getting strings, but the concept is the same.
Last edited on
Topic archived. No new replies allowed.