I've a question whose solution I can't figure out at all.
The question is:
Suppose I declare int count =140
Now I want my program to be such that whenever I press a key on keyboard, the count should decrease by one, in the same way that we see on twitter. It should be visible as I type, not on EOF.
The windows.h header file is used here, for the gotoXY() function. If you leave that out, and the calls to it, yes, the program still works, except that each new sentence will be printed on a separate line. You would also need to add an << endl; after cout << sentence << " (Letters remaining.. " << count << ") ";
OR, it could be done using the '\b' command, which moves the cursor back a space. string back(10,'\b') would create 10 '\b', etc.