stgructure initialization stype shows as error

Kishore kitts.mailinglists at gmail.com
Fri Aug 29 14:10:33 UTC 2008


On Friday 29 Aug 2008 12:29:14 pm Hamish Rodda wrote:
> Hi,
>
> On Friday 29 August 2008 15:25:57 Kishore wrote:
> > In C, structures can be initialized by either having comma separated
> > values or by using member names as is shown below. Using the second
> > method, shows a red error mark with kdevelop.
> >
> > struct SomeStruct
> > {
> >     int a;
> >     int b;
> > };
> >
> > struct SomeStruct someStruct =
> > {
> >     a: 10, //<-- : on this line is marked in red
> >     b: 20
> > };
> >
> > The above code is valid code but is not considered so by kdevelop.
>
> Is this the same for c++? (we don't officially support C yet)

It is the same in C++. I used the above code in a C++ file. The code compiles 
and works fine. I am not entirely sure if it is standards compliant though.
-- 
Cheers!
Kishore




More information about the KDevelop-devel mailing list