Created
April 2, 2011 19:21
-
-
Save nolanw/899789 to your computer and use it in GitHub Desktop.
Check for at least C99 at runtime.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static int IsC99() | |
{ | |
return (2//* */2 | |
== 2); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() | |
{ | |
if (IsC99()) | |
printf("hello from C99 or beyond\n"); | |
else | |
printf("hello from C89 or earlier\n"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment