C #define macros

后端 未结 7 1377
情书的邮戳
情书的邮戳 2020-12-21 06:59

Here is what i have and I wonder how this works and what it actually does.

#define NUM 5
#define FTIMES(x)(x*5)

int main(void) {
    int j = 1;
    printf(\         


        
7条回答
  •  攒了一身酷
    2020-12-21 07:03

    define is just a string substitution.

    The answer to your question after that is order of operations:

    FTIMES(j+5) = 1+5*5 = 26

    FTIMES((j+5)) = (1+5)*5 = 30

提交回复
热议问题