Skip to content

Instantly share code, notes, and snippets.

@koron
Last active January 12, 2024 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koron/9398af31503fb286d79401d4e76ce5a3 to your computer and use it in GitHub Desktop.
Save koron/9398af31503fb286d79401d4e76ce5a3 to your computer and use it in GitHub Desktop.
foo() と foo(void) の違いを示す例
int foo();
void caller() {
foo();
}
/* コンパイルは通る */
int foo();
void caller() {
foo(123, "abc");
}
/* これもコンパイルが通る */
int foo(void);
void caller() {
foo();
}
/* これも当然コンパイルは通る */
int foo(void);
void caller() {
foo(123, "abc");
}
/* これはコンパイルエラーになって通らない */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment