初級 › error: expected ';' before ... の原因と直し方 › パターン5
error: expected ';' before ... の原因と直し方
文末のセミコロンを書き忘れたときに出るエラーです。
1 #include <stdio.h> 2 3 int main(void) { 4 double pi = 3.14_ ^ 5 printf("%f\n", pi); 6 return 0; 7 }
main.c:5:5: error: expected ',' or ';' before 'printf'
空欄を埋めてコンパイル・実行を通す
double型の宣言でも同じです。型に関わらずセミコロンは必須です。
次の問題