R
Robert Shull
I am taking a class in C++. We are creating console
applications using Visual C++.NET 2002. The assignment is
to create a "mailing label" using information coded into
the program. My code looks like this:
#include <iostream>
using std::cout;
using std::endl;
void main(void)
{
cout<<"Joe Schmoe"<<endl;
cout<<"5991 Crestview Ave"<<endl;
cout<<"Fairfield, OH 45014"
}//end of main
When I run this program the console appears and then
disappears before I can see the output. My instructor
suggested adding a getch() at the end of main, but the
compiler notes that there is an undeclared identifier.
How can I correct this problem with getch? Is there
another way to keep the console open until the user hits
a key?
Thank you,
Robert
applications using Visual C++.NET 2002. The assignment is
to create a "mailing label" using information coded into
the program. My code looks like this:
#include <iostream>
using std::cout;
using std::endl;
void main(void)
{
cout<<"Joe Schmoe"<<endl;
cout<<"5991 Crestview Ave"<<endl;
cout<<"Fairfield, OH 45014"
}//end of main
When I run this program the console appears and then
disappears before I can see the output. My instructor
suggested adding a getch() at the end of main, but the
compiler notes that there is an undeclared identifier.
How can I correct this problem with getch? Is there
another way to keep the console open until the user hits
a key?
Thank you,
Robert