0

my administrator at school blocked commands for command prompt so I can't use system pause or system color commands....anyone know a way around this?

3
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by Joatmon
0

system pause seems to be frowned upon anyway, but the best replacement (if you don't care about portability) could just be to use

#include <conio.h> // windows only, for getch
cout << "Press any key to continue."'
getch(); //waits until one key is pressed

Sorry I don't know about color commands, I never used them.

0

system pause seems to be frowned upon anyway, but the best replacement (if you don't care about portability) could just be to use

#include <conio.h> // windows only, for getch
cout << "Press any key to continue."'
getch(); //waits until one key is pressed

A terrible suggestion. Why suggest a function that is not available in most compilers? Anything wrong with a simple getline() , which is defined in ALL compilers?

0

Because I don't use all compilers and thus never had the opportunity to gain experience from it, I choose that because getline requires enter, but this just uses any key to continue. I already mentioned that it wasn't portable in the first place.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.