Re: Visual C++ support of C99 by using "C++ mode" (/TP)
- From: albert.neu@xxxxxxxxx
- Date: 31 Mar 2007 04:38:02 -0700
On Mar 31, 1:20 pm, "Harald van Dijk" <true...@xxxxxxxxx> wrote:
albert....@xxxxxxxxx wrote:
The following is valid C99 code:
/************* c_test.c ***************/
#include <stdio.h>
#include <stdbool.h>
#include <limits.h>
int main( void )
{
bool b = true;
if (b)
printf("hello world\n");
char c = 5;
printf("%hhd\n", c);
int size = INT_MAX / 10000;
printf("%d\n", size);
char a[size];
a[0] = 'a';
a[1] = 'b';
a[2] = '\0';
printf("%s\n", (char *)&a);
return 0;
}
The above C99 code can be compiled on VC++, by just commenting the 2nd
line (see below!)
In other words, by making it valid C++ and invalid C99.
What's your point?
My point is:
Maby the difference between VC++ in C++ mode and C99 is marginal.
(In the example above, only the header is not known in the current VC+
+ (but bool is supported anyway))
And maby this difference will get even smaller, if VC++ adopts (or
conforms more closely to) newer C++ standards.
Albert
.
- Follow-Ups:
- Re: Visual C++ support of C99 by using "C++ mode" (/TP)
- From: Servé Laurijssen
- Re: Visual C++ support of C99 by using "C++ mode" (/TP)
- References:
- Visual C++ support of C99 by using "C++ mode" (/TP)
- From: albert . neu
- Re: Visual C++ support of C99 by using "C++ mode" (/TP)
- From: Harald van Dijk
- Visual C++ support of C99 by using "C++ mode" (/TP)
- Prev by Date: Re: C ethics question
- Next by Date: Re: Visual C++ support of C99 by using "C++ mode" (/TP)
- Previous by thread: Re: Visual C++ support of C99 by using "C++ mode" (/TP)
- Next by thread: Re: Visual C++ support of C99 by using "C++ mode" (/TP)
- Index(es):
Relevant Pages
|