Skip to content

Instantly share code, notes, and snippets.

@NaokiKuzumi
Created June 17, 2013 08:31
Show Gist options
  • Save NaokiKuzumi/5795458 to your computer and use it in GitHub Desktop.
Save NaokiKuzumi/5795458 to your computer and use it in GitHub Desktop.
関数の宣言func(void)とfunc()は厳密に違う。 引数のない関数を宣言するのはfunc(void)でなければならない。
void hoge(){
}
void fuga(void){
}
int main(void){
hoge("piyo");
fuga("java");
return 0;
}
/*
$ gcc -Wall tmp.c
tmp.c: 関数 ‘main’ 内:
tmp.c:9:2: エラー: 関数 ‘fuga’ への引数が多すぎます
tmp.c:4:6: 備考: ここで宣言されています
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment