Topic: initialize a compound automatic variable in its declaration.


Author: steve.connet@cox.net (StevePhx)
Date: Wed, 21 May 2003 19:26:49 +0000 (UTC)
Raw View
A friend asked this question and I could not answer him. I'd like to
find him an answer and I know these two newsgroups to be very
valuable. I am cross-posting to comp.std.c as well as comp.std.c++
because I'm not sure if this is a C feature, or C++ feature. Thank
you. Assume in his question that Uint8 is typedef'd as unsigned char.

--------------------
Steve,

Here's an example of what I was asking about:

void foo(Uint8 a, Uint8 b)
{
   Uint8 bar[] = {0xfa, 0xf3, 0x20, 0, 0, a, b};
   ...
}

Used to be I couldn't do that (Charla used to hear me whine about it
all the time, 'cause I could do it in other languages). But now I can.
Do you know at what point in time in our compiler history this became
possible?

Do you know whether this has always been valid under ANSI C++, or is
it a gcc-specific feature, or what?

- Curious George
--------------------


--
Steve

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]