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?

Recommended Answers

All 3 Replies

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.

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?

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.