No Return to Command Line in C++
In my C++ programme, the main function calls a routine ShowGraphs, in which gnuplot is opened, plots some data to the screen, and then exits gnuplot when I press q (as usual in gnuplot). However, after the graphs disappear from the screen the programme does not return to the command line, but only if I terminate the programme with Ctrl+C or press s and then Enter, because I have inserted a most unappealing while loop:
Code:
int ShowGraphs() |
Hi -
I think "getchar()" already has exactly the functionality you're looking for (just wait, until the user types something in and hits <Enter> ... or, more simply, until the user just hits <Enter>...) Try this: Code:
int ShowGraphs() Code:
getchar (); |
I didn't think of the last one, which is actually very simple and neat, thanks. What I'd really like is that it quits the programme after the gnuplot graphs have been closed by 'q', but for the time being I'm happy with it.
|
All times are GMT -5. The time now is 04:19 AM. |