わざとエラーを発生させる
#include <iostream>
using namespace std;
int main(){
cout << "hello world\n"
}
void main(){
cout << "hello world\n";
}
### コンパイルオプション
オブジェクトファイル -c
実行ファイル -o
静的ライブラリをリンク -L
ヘッダを追加 -l
警告 -W, -wall
機能有効 -std=c++11
最適化 -O
#### 変数
int main(){
int a = 12345;
int b = 98765;
cout << a + b << endl;
cout << a - b << endl;
}
intは32bit
#include <iostream>
#include <limits>
using namespace std;
int main(){
cout << numeric_limits<int>::lowest() << ", " << numeric_limits<int>::max() << endl;
}
floatが32ビットだがdoubleは64bit
int main(){
double a = 1.23;
double b = 5.43;
cout << a * b << endl;
cout << a / b << endl;
}