Is there a #define for C99?

前端 未结 2 1156
我在风中等你
我在风中等你 2020-12-14 08:36

I want to do something in C99 one way, otherwise to perform it another way. What is the #define to check for?

#ifdef C99
...
#else
...
#endif
         


        
2条回答
  •  心在旅途
    2020-12-14 08:50

    #if __STDC_VERSION__ == 199901L
    /* C99 */
    #else
    /* not C99 */
    #endif
    

    Change == to >= if you want to test for C99 and later.

提交回复
热议问题