How to check if the C compiler standard is C99 in C

1 Answer

0 votes
#include <stdio.h>
 
int main()
{
    printf("%ld\n", __STDC_VERSION__);
       
    if (__STDC_VERSION__ == 199901L) {
       puts("PREDEF_STANDARD_C_1999");
    }
}
 
 
 
/*
run:
 
199901
PREDEF_STANDARD_C_1999
 
*/

 



answered Apr 20, 2022 by avibootz
edited Aug 8, 2024 by avibootz

Related questions

2 answers 214 views
1 answer 167 views
1 answer 238 views
1 answer 99 views
1 answer 151 views
2 answers 133 views
1 answer 141 views
141 views asked Apr 22, 2022 by avibootz
...