I am new to C++, I am actually learning and in the experimentation part, however, while experimenting I ran into an issue with the cout function. The program fails when compiling. I was wondering if you guys could assist me: Here is the source I wrote.
#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
signed short int a;
signed short int b;
signed short int c;
a = 25;
b = 8;
c = 12;
cout << a << endl;
cout << b << endl;
cout << c << endl;
cout << "What is the sum of a + b - c? The answer is: ";
cout << a + b - c;
cout << endl;
cout << "Why is this?" << endl;
cout << "This is because: ";
cout << "a + b equals: " << a + b << endl;
cout << "and that minus " c << " is" << a + b - c << endl;
cout << "If that makes sense, then press enter to end the program.";
cin.get();
return 0;
}
I was also wondering what signed and unsigned meant, I think it is dependent as per the compiler? I am using Visual C++ 2008 Express Edition.
Thanks for anyone that can point out my error(s) and help me!