Loading ...
Sorry, an error occurred while loading the content.

Re: Fastest way to append line or char to a buffer

Expand Messages
  • Nikolai Weibull
    ... No worries. nikolai
    Message 1 of 24 , Aug 30, 2006
    • 0 Attachment
      On 8/30/06, Chris Littell <chris.littell@...> wrote:
      > On 8/30/06, Nikolai Weibull <now@...> wrote:
      > > In C99 you can initialize values "out of order", yes, but you can't do
      > > it with ranges. Ranges are a GNU C extension. The propagation
      > > neither happens in any of the ANSI standards, nor in the GNU extended
      > > version of C. It's simple to test write the following in "a.c":
      > >
      > > #include <stdio.h>
      > >
      > > int
      > > main(void)
      > > {
      > > int is[2] = { 1 };
      > > int i;
      > >
      > > for (i = 0; i < 2; i++)
      > > printf("%d\n", is[i]);
      > >
      > > return 0;
      > > }
      > >
      > > And then to actually test it:
      > >
      > > $ for std in c89 c99 gnu89 gnu99; do gcc -std=$std a.c && echo $std:
      > > && a.out; done
      > > c89:
      > > 1
      > > 0
      > > c99:
      > > 1
      > > 0
      > > gnu89:
      > > 1
      > > 0
      > > gnu99:
      > > 1
      > > 0
      > >
      > > > http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/gcc/designated-inits.html
      > >
      > > Nowhere in that section does it say that the last value is propagated.
      >
      > Wow, I reread it and you are correct. I'm not sure why I held that
      > assumption...
      > Also thanks for the examples.

      No worries.

      nikolai
    Your message has been successfully submitted and would be delivered to recipients shortly.