หมายเหตุ
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลอง ลงชื่อเข้าใช้หรือเปลี่ยนไดเรกทอรีได้
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลองเปลี่ยนไดเรกทอรีได้
reuse of macro formal 'identifier'
Remarks
The formal parameter list of a macro definition uses the identifier more than once. Identifiers in the macro's parameter list must be unique.
Example
The following example generates C2009:
// C2009.cpp
#include <stdio.h>
#define macro1(a,a) (a*a) // C2009
int main()
{
printf_s("%d\n", macro1(2));
}
Possible resolution:
// C2009b.cpp
#include <stdio.h>
#define macro2(a) (a*a)
#define macro3(a,b) (a*b)
int main()
{
printf_s("%d\n", macro2(2));
printf_s("%d\n", macro3(2,4));
}