Skip to content

Instantly share code, notes, and snippets.

@nolanw
Created April 2, 2011 19:21
Show Gist options
  • Save nolanw/899789 to your computer and use it in GitHub Desktop.
Save nolanw/899789 to your computer and use it in GitHub Desktop.
Check for at least C99 at runtime.
static int IsC99()
{
return (2//* */2
== 2);
}
#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