|
From: Brian C. <bri...@ho...> - 2001-09-06 07:33:43
|
Hi, I am having problems when I try to execute my programs.
To start off, I am writing basic Console Applications. This is a basic
application that I am trying to get to work.
***********************************************
#include <stdio.h>
#include <iostream.h>
int main(int argc, char *argv[])
{
int Age;
cout << "What is your age?\n";
cin >> Age;
cout << "Your age is " << Age << " .\n";
return 0;
}
Well, as you can see, I ask the user to imput their age. Then as soon
as they do and press enter, you can see it display the cout string that
tells them their age, but it only displays it for a second and then the
window closes.
My question was, is there a tag that I can add to keep it from closing
the window immediatly? I am not sure if it just a bug, or I just have a
missing string. But the reason I am confused is because I am taking a
programming course at college, and we use Microsoft Visual C++. The only
difference that I see is instead of the <stdio.h> tag at the top of the
program, we use <stdafx.h>. Could this have anything to do with it, or is
there just another string that this program uses that makes it finish
answering the question and not just immediatly terminate the program.
Any feedback you could give me would be greatly appreciative.
Thank You,
Brian Crabtree
Reidsville NC
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
|