Square of a number being defined using #define

后端 未结 11 1176
说谎
说谎 2020-11-27 08:06

I was just going through certain code which are frequently asked in interviews. I came up with certain questions, if anyone can help me regarding this?

I am totally

11条回答
  •  清酒与你
    2020-11-27 08:16

    It's a macro! So it returns exactly what it substitutes.

    i = 4/4*4;   Which is 4...
    j = 64/4*4;   Which is 16...
    

    Try this for your macro:

    #define square(x) ((x)*(x))
    

提交回复
热议问题