Re: why still use C?

From: Jeremy Yallop (jeremy_at_jdyallop.freeserve.co.uk)
Date: 10/16/03


Date: 16 Oct 2003 13:49:51 GMT

Jirka Klaue wrote:
> #include "stdio.h"
> int main(void)
> {
> int
> #ifdef __cplusplus
> i = 2;
> #elif defined __STDC_VERSION__ && __STDC_VERSION__ == 199901L
> i = 1;
> #else
> i = 0;
> #endif
> puts(i == 2 ? "C++" : i == 1 ? "C99" : "C89");
> return 0;
> }

A C89 implementation is allowed to define a __cplusplus macro, AFAICT.
(You also classify C0X as C89).

Jeremy.



Relevant Pages

  • Re: Counting poker hands
    ... suggests the vast majority of the run time is spent in the 'classify' ... It does both 5 and 7 card stud calculations by monotonically mapping ... How do you adjust the calls from type 'enum class' to 'int'? ...
    (comp.lang.c)
  • Re: Counting poker hands
    ... It does both 5 and 7 card stud calculations by monotonically mapping ... classify the hand into the rough hand categorization (two of a kind, ... How do you adjust the calls from type 'enum class' to 'int'? ...
    (comp.lang.c)
  • Re: Counting poker hands
    ... suggests the vast majority of the run time is spent in the 'classify' ... It does both 5 and 7 card stud calculations by monotonically mapping ... the execution time from about 190 secs. to 100 secs. on my old ... How do you adjust the calls from type 'enum class' to 'int'? ...
    (comp.lang.c)
  • Re: main return value stange question
    ... can explode:) I'll give it a shot... ... mainwill work fine on a C89 implementation, ... by a mythical C99 implementation. ... to an int. ...
    (comp.lang.c)
  • Re: Counting poker hands
    ... suggests the vast majority of the run time is spent in the 'classify' ... It does both 5 and 7 card stud calculations by monotonically mapping ... int classify ... unsigned char tmp; ...
    (comp.lang.c)