2016年4月3日 星期日

[C] ## macro operator


Replace each variable, then understand how it work.


#include <stdio.h>
#define DECLARE_AND_SET(type, varname, value) type varname = value; type orig_##varname = varname;

void main()
{
    DECLARE_AND_SET( int, area, 2 * 6 );
    printf("%d\n",area);
    printf("%d\n",orig_area);
}

Reference:

0 意見:

張貼留言