私はC ++を初めて使用します。実際に学習していて、実験の部分にいますが、実験中にcout関数の問題に遭遇しました。コンパイル時にプログラムが失敗します。皆さんが私を助けてくれるかどうか疑問に思っていました: ここに私が書いたソースがあります.
#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;
}
また、signed と unsigned が何を意味するのか疑問に思っていましたが、コンパイラに依存していると思いますか? Visual C++ 2008 Express Edition を使用しています。
私のエラーを指摘して助けてくれる人に感謝します!