初級 › error: 'x' was not declared in this scope の原因と直し方 › パターン2
error: 'x' was not declared in this scope の原因と直し方
宣言していない変数を使ったときに出るエラーです。
1 #include <iostream> 2 int main() { 3 int score = 90; 4 std::cout << ______ << std::endl; ^ 5 return 0; 6 }
main.cpp:4:18: error: 'scroe' was not declared in this scope; did you mean 'score'?
空欄を埋めてコンパイル・実行を通す
scoreのタイプミスであるscroeという名前は宣言されていないため、コンパイラは未知の識別子として扱います。
次の問題