Hi, I'm new to C++ and I noticed that after the program is finished running it will display the phrase, "Press any key to continue..." I was simply wondering if it is possible to change this phrase to same something else, like "Press any key to exit." Which seems more fitting to me. Is this possible, and if so how do i do it? Thanks in advance.
It depends on your compiler. Most compilers will give you that message if you use system("pause"). You can make your own by using cin.ignore(100) and cout whatever you want.
What is done by system() is it issues a command to the operating system just as if you had typed it into a shell. If you use system() you must be careful that you handle the differences between the systems you use it on. For something this simple, use the normal i/o facilities to display a message.
correct me if I'm wrong, but isn't system() OS specific? what I'm getting at is if i used for example system("cls"), and then tried to run the program on a non-windows/dos machine, it would'nt work...right?
If you didn't put the message there to begin with, then it is, as firedraco said, something your IDE is doing for you so that you can see your program's output before the console window disappears. This is a typical thing for Windows-specific compilers, AFAIK. You'll have to run your program directly (instead of from the IDE) to see it work properly.
@markXD07: You are technically correct, it's proper to have the main function return an integer because the OS expects something indicating success or failure, Zero indicates success hence "return 0;" at the end of most programs on this site.