Re: why still use C?

From: cody (dont.spam.me.deutronium_at_gmx.de)
Date: 10/16/03


Date: Thu, 16 Oct 2003 23:57:20 +0200


"Mark Gordon" <spamtrap@flash-gordon.me.uk> schrieb im Newsbeitrag
news:20031015232209.128f9a60.spamtrap@flash-gordon.me.uk...
> On Wed, 15 Oct 2003 22:17:35 +0200
> "cody" <dont.spam.me.deutronium@gmx.de> wrote:
>
> Please don't trim the attributions since it prevents people from seeing
> who said what.
>
> > > int test(int size)
> > > {
> > > int *new = malloc(size); /* two non-C++isms in this line */
> > > return 1 //*
> > > -1 + 1; /* 0 in C99, 1 in C++ */
> > > }
> >
> > is the missing semicolon at the end of a block allowed in C?
>
> A semicolon is required to terminate every C statement, however in C99
> there is no missing semicolon in the above.
>
> HINT: C99 added a form of // commenting.

int test(int size)
{
       int *new = malloc(size); /* two non-C++isms in this line */

       return 1 //* <-- the c version misses a semicolon here,
additionally //* will imho produce no valid comment in c.

             -1 + 1; /* 0 in C99, 1 in C++ */
}

--
cody
[Freeware, Games and Humor]
www.deutronium.de.vu || www.deutronium.tk


Relevant Pages

  • Re: why still use C?
    ... Please don't trim the attributions since it prevents people from seeing ... A semicolon is required to terminate every C statement, however in C99 ... there is no missing semicolon in the above. ...
    (comp.lang.c)
  • Re: How to extract bytes from a long?
    ... "Irrwahn Grausewitz" schrieb im Newsbeitrag ... > Actually, there are two syntax errors, of which the ... > missing semicolon is one. ...
    (comp.lang.c)