-
February 15th, 2009, 02:27 AM
#1
cin.get(); Doesn't Work for me... Anyone ??
Hey everyone,
been working hard to get past the newbie stage ! However I have yet one more totally newbie question.
when I use cin.get(); at the end of a program or the end of a function to keep the prompt window open.....
IT DOESN'T EVER WORK ~!!
I see it in everyone elses code used the same way...... I think.
here's an example. when I run even the ol' simple " hello world " program with cin.get(); at the end, it won't stay open. The program runs, and the window closes in about 0.343 seconds.
here's a quick example code:
Code:
#include <iostream>
using namespace std;
int main()
{
cout << "Hello world!" << endl;
return 0;
cin.get();
}
Am I using it correctly ?
if so why doesn't this work for any of my programs ?
thanks
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|