How to check if the C implementation is C standard in C

2 Answers

0 votes
#include <stdio.h>

int main(void)
{
    fprintf(stderr, "%d", __STDC__);
    
    return 0;
}


 
// If 1, the implementation is C Standard
    
/*
run:

1

*/

 



answered Jul 29, 2017 by avibootz
edited Apr 20, 2022 by avibootz
0 votes
#include <stdio.h>
 
int main(void)
{
    printf("%d", __STDC__);
     
}


  
// If 1, the implementation is C Standard
     
/*
run:
 
1
 
*/

 



answered Apr 20, 2022 by avibootz
...