Re: Clearing the screen - Press any key...

From: Steve (aeroman10_at_nospam-yahoo.com)
Date: 09/01/04


Date: Wed, 01 Sep 2004 06:20:32 GMT

Thanks, that worked...
Had a problem with that for a second but it was because I didnt have
#define<string>

-- 
Steve -  A+, I-Net+
Free PC Tech Support - http://www.webzila.com
DLL Files - http://www.dllplanet.com
Live Support - http://www.webzila.com/livesupport
"Ulrich Eckhardt" <doomster@knuut.de> wrote in message 
news:2pl3osFlbl0iU1@uni-berlin.de...
> Steve wrote:
>> //Sample code for pressing any key to continue...
>> char anykey;
>> cout << "Press any key to continue...";
>> cin >> anykey;
>> cout <<"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
>> //End sample
>>
>> So that code requires that you actually enter some character before
>> pressing enter. How do you make it so that you can simply press the
>> space bar and press enter to clear the screen?
>
> std::cout << "<enter>" << std::flush;
> std::string str;
> std::getline( std::cin, str);
>
>> Also is there a better way to clear the screen other than using
>> \n\n\n\n\n\n\n\n\n\n (the method for clearning the screen must be an
>> ANSI/ISO Standard C++ command/code).
>
> No, there isn't.
>
> For text-based, menu driven programs, you should take a look at one of the
> curses libraries. They feature much more, e.g. tracking single keypresses
> and positioning the cursor and are available for a wide range of
> platforms.
>
> Uli
>
> -- 
> FAQ: http://ma.rtij.nl/acllc-c++.FAQ.html 


Relevant Pages

  • Re: Is Michael Glasser being watched? - WAS- Re: Kernel Panic
    ... With Steve in my KF his desperation will only get more extreme. ... If anyone cares, I am currently teaching at one college, and will be ... do private tech support and tutoring... ... Sure, Snit... ...
    (comp.sys.mac.advocacy)
  • Re: What the heck is with the new iPod?
    ... that's *Steve* you are responding to. ... let us look at the *requirements* to be considered DOA: ... called tech support from help transfering files. ... contractual obligations. ...
    (comp.sys.mac.advocacy)
  • Re: What the heck is with the new iPod?
    ... that's *Steve* you are responding to. ... let us look at the *requirements* to be considered DOA: ... called tech support from help transfering files. ... contractual obligations. ...
    (comp.sys.mac.advocacy)
  • Re: Windows XP
    ... Steve wrote: ... > software change may have caused this. ... > choose the most recent good configuration by pressing ...
    (microsoft.public.security.virus)
  • Re: Is Michael Glasser being watched? - WAS- Re: Kernel Panic
    ... Snit wrote: ... Steve is the NUMBER ONE troublemaker on this group. ... If anyone cares, I am currently teaching at one college, and will be ... a couple of business offices as well as doing occasional tech support at ...
    (comp.sys.mac.advocacy)