//replaced system("pause") for linux friendly cin.ignore; //if you have newline before this line, then you should add this(or just use it because why not?) cin.get(); // waits for a character (or just waits for your enter)