매개 변수 이름 생략, C++ 대 C C++에서는 어떤 상황에서는 매개 변수의 이름을 생략하는 경향이 있습니다.그런데 C에서 파라미터 이름을 생략했을 때 오류가 발생했습니다. 코드는 다음과 같습니다. void foo(int); //forward-decl, it's OK to omit the parameter's name, in both C++ and C int main() { foo(0); return 0; } void foo(int) //definition in C, it cannot compile with gcc { printf("in foo\n"); } void foo(int) //definition in C++, it can compile with g++ { cout