G
gilly_54
Guest
I'm using "Visual C++ 2008 Express Edition" for my compiling and stuff.
OS: Windows Vista
So I have a couple of questions.
1. I mostly code Win32 console applications, take this really simple bit of code for example:
Now back when I used Visual C++ 2005 Express, I don't recall having to put in cin.get(); twice for the console window to stay and show me a result. If I put it in once, it just opens and closes as soon as the program runs (which is a split second), its as if I'm not even putting in a cin.get();
I've seen people using return 0; and I've always wondered about it, I tried shoving it in a few times to no avail...
So, do I have to stick to two cin.get();'s? Or is there a simpler way that I probably have no clue of?
OS: Windows Vista
So I have a couple of questions.
1. I mostly code Win32 console applications, take this really simple bit of code for example:
Code:
#include "stdafx.h"
#include <iostream>
using namespace std;
int main(){
int age;
cout<<"Enter your age: ";
cin>>age;
cout<<"Your age is: "<<age<<endl;
cin.get();
cin.get();
}
I've seen people using return 0; and I've always wondered about it, I tried shoving it in a few times to no avail...
So, do I have to stick to two cin.get();'s? Or is there a simpler way that I probably have no clue of?