This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: braces around scalar initializer



David Cullen wrote:

> Why doesn't this work:
>
> Rectangle *cherry[]    = { { 10, 10, 100, 100 }, NULL };
>
> Display.c:137: warning: braces around scalar initializer
> Display.c:137: warning: (near initialization for `cherry[0]')
>
> May God bless you,
> David Cullen

        The compiler is expecting a list of pointers (scalars), because
"cherry" is an array of pointers, not an array of  "Rectangle"s. You can
only use embedded braces for members which are agregates themselves.

         Regards,

                                     Joaquín Ferruz
begin:vcard 
n:Ferruz Melero;Joaquin
tel;fax:34 954 48 73 40
x-mozilla-html:FALSE
org:Escuela de Ingenieros de Sevilla;Ingeniería de Sistemas y Automática
adr:;;Camino de los Descubrimientos, S/N;Sevilla;;41092;España
version:2.1
email;internet:ferruz@cartuja.us.es
title:Profesor Titular de Universidad
end:vcard

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]