Hi, I just started writing c++, and this is probably a stupid question, but how do I make my c++ code into a program? I use code::blocks (
http://www.codeblocks.org/ ) which includes a compiler, etc, and when I create a new project, it saves the project in a folder, and in that folder is another folder named "bin", and inside "bin" is an Application file that I thought was my program, but whenever I try to open it, it just closes again after I enter all of my digits to add (it's an addition calculator)! The program works perfectly if I "Build and Run" it in code::blocks. Help!
(Here is my code below, it's supposed to be a basic calculator)
*code starts here*
#include <iostream>
using namespace std;
int calculator()
{
int a;
int b;
int c;
int d;
int e;
int f;
int g;
int h;
int output;
cout << "This program is an addtion calculator." << endl;
cout << "This program will not accept decimals." << endl;
cout << "The maximum number of digits that you can add is 8." << endl;
cout << "If you wish to add less digits than 8, after your desired" << endl;
cout << "numbers are plugged in, keep entering 0 for the remaining digits." << endl;
cin >> a;
cin >> b;
cin >> c;
cin >> d;
cin >> e;
cin >> f;
cin >> g;
cin >> h;
output = a + b + c + d + e + f + g + h;
cout << "The sum of those numbers is " << output << "." << endl;
}
int main()
{
calculator();
return 0;
}