Sunday, July 18, 2010

How to create C++ code style in gcc compile with no error?

How to create C++ code style in gcc compile with no error?
: use -std=c99 option

you can use C++ style coding like the following

int main()
{
printf("Use C99\n");

int a = 0;
for( int i = 0; i < 10; i++ )
{
printf("i = %d\n");
}
}

2 comments:

  1. basically gcc uses GNU C89 syntax.
    C99 syntax is created in 1999.

    ReplyDelete