Re: initializer must be constant error bug?
- From: "Ivan A. Kosarev" <ik@xxxxxxxxxxx>
- Date: Tue, 24 Jan 2006 12:49:12 +0300
"Mike H." <mikehg_67@xxxxxxxxx> wrote in message
news:43d5a8db$0$9239$6d36acad@xxxxxxxxxxxxxxxxxxxxxxxx
>
> I'm getting the error " initializer must be constant" from code such as:
>
> void foo(int x, int y, int w, int h)
> {
> RECT rc = { x,y,w,h };
> }
>
> This should work for auto variables, correct?
Nope, not in C89. In both C99 and C++ that would be correct.
--
Unicals Group -- Embedded C++ for Your IP Cores
http://www.unicals.com
.
- Follow-Ups:
- Re: initializer must be constant error bug?
- From: Mike H.
- Re: initializer must be constant error bug?
- References:
- initializer must be constant error bug?
- From: Mike H.
- initializer must be constant error bug?
- Prev by Date: Re: lcc -ansic option
- Next by Date: Re: initializer must be constant error bug?
- Previous by thread: Re: initializer must be constant error bug?
- Next by thread: Re: initializer must be constant error bug?
- Index(es):
Relevant Pages
|
|