how to avoid name conflicts coming from #define in C? (or C++)
问题 This should be very basic question, and I can avoid this situation by changing some names but I think maybe there is something I am missing here. I have made a simplest code for this problem. conv.h : 1 struct convpar_ { 2 int K; 3 } convpar_; test.c : 1 #include <stdio.h> 2 #include "conv.h" 3 4 #define K 7 5 6 typedef struct convpar_ convpar; 7 8 void func1(convpar cp) 9 { 10 printf("cp.K = %d\n", cp.K); 11 } 12 13 main() 14 { 15 convpar cp = {K}; 16 17 func1(cp); 18 } If I do cc test.c -o