初級 › error: expected ',' or ';' before ... の原因と直し方 › パターン3
error: expected ',' or ';' before ... の原因と直し方
文末のセミコロンを書き忘れたときに出るエラーです。
1 #include <iostream> 2 int main() { 3 int a = 3; 4 int b = 4_ ^ 5 std::cout << (a + b) << std::endl; 6 return 0; 7 }
main.cpp:5:5: error: expected ',' or ';' before 'std'
空欄を埋めてコンパイル・実行を通す
複数の変数宣言のうち、どれか1つでもセミコロンを忘れると同じエラーになります。
次の問題