sanket_203
Right off the assembly line
I recently installed Dev C++ (ver. 4.9.9.2) on my PC to complie and run C++ programs. I am new to programming field. When ever i run C++ programs in Dev C++ the programs compiles and runs with no errors . But it runs only halfway.(i.e it doesn't execute the whole program).
For eg. Please consider the following simple C++ program
When I run this program, it ask for the "Enter integers to be added."
After I enter the two nos. and then press enter, the program automatically closes and returs to Dev C++ environment. What should I do to solve this problem. This happens with all the C++ programs. C programs are running fine with Dev C++. Please Help.
I have an AMD Athlon 3200 2.2 GHz System with 512 RAM running on Windows XP service Pack 2. I am using the Zune Theme from Microsoft.
I am also attaching a JPEG screen shot of the Program.
*sanketchauhan.co.cc/cpp_program.JPG
*www.flickr.com/photos/7747269@N08/3570789586/*sanketchauhan.co.cc/cpp_program.JPG
For eg. Please consider the following simple C++ program
Code:
#include <iostream>
using namespace std;
class Addition
{
public:
int a, b, total;
void sum()
{
cout << "Enter
integers to be added:" << endl;
cin >> a >> b;
total = a + b;
cout << "The sum is " << total << endl;
}
};
int main()
{
Addition C1
C1.sum();
return 0;
}
After I enter the two nos. and then press enter, the program automatically closes and returs to Dev C++ environment. What should I do to solve this problem. This happens with all the C++ programs. C programs are running fine with Dev C++. Please Help.
I have an AMD Athlon 3200 2.2 GHz System with 512 RAM running on Windows XP service Pack 2. I am using the Zune Theme from Microsoft.
I am also attaching a JPEG screen shot of the Program.
*sanketchauhan.co.cc/cpp_program.JPG
*www.flickr.com/photos/7747269@N08/3570789586/*sanketchauhan.co.cc/cpp_program.JPG
Last edited: