I searched the forum and help, and couldn't find anything specific enough, that is why I made this thread. So I am currently using Dev-C++ 4.9.9.2 as my preferred compiler. I was reading the beginner section of this website and was reading this code:
So, I changed a few things:Code:#include <iostream> using namespace std; int main() { int thisisanumber; cout<<"Please enter a number: "; cin>> thisisanumber; cin.ignore(); cout<<"You entered: "<< thisisanumber <<"\n"; cin.get(); }
The problem with my code is that I can type in a word but, when I hit enter, it displays the word for a brief flash and then the Dos box closes. If anyone can point me in the right direction with a link or advice, that would be much appreciated. By the way, I am completely new to programming and this website.Code:#include <iostream> using namespace std; int main() { char word; cout<<"Please type a word and I will show it back to you:"; cin>> word; cin.ignore(); cout<<"You entered: "<< word <<"\n"; cin.ignore(); cin.get(); }
-Paul



LinkBack URL
About LinkBacks



"