0

I have a code from ex colleague. he declared some sort of macro like this :

#define work_dir "/usr/io/track"
#define macro_test(a1,a2,a3,a4)\
{\
    .name=a1,\
    .family=a2,\
    .idnum=a3,\
    .badlog=a4,\
    }

and later on he called this macro like:

macro_test(test "John","macdonald",14,"no");

I know this might not enough detail, however I am just wondering about declaring this sort of macro. it seems to initialize structure but it is not. much appreciated if you can help me.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
SS_SS
  • 1
  • This macro is designed to initialize array of structure and it works now. So it is call in declaring another structure which – SS_SS Dec 15 '16 at 23:04
  • This macro is designed to initialize array of structure and it works now. So it is called inside declaring another structure which has all those field. so the problem is solved – SS_SS Dec 15 '16 at 23:06

0 Answers0