Talk About Network

Google





Programming > C - C++ Learning > Re: initialisin...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 5 Topic 4125 of 4400
Post > Topic >>

Re: initialising built in types with curly braces

by Ian Collins <ian-news@[EMAIL PROTECTED] > Apr 21, 2008 at 04:02 PM

Barry Schwarz wrote:
> On Sun, 20 Apr 2008 15:03:24 -0700 (PDT), Sard <Sardaukary@[EMAIL PROTECTED]
>
> wrote:
> 
>> I've just discovered that this is legal in c++.
>>
>> int x={10};
>>
>> What's the point of allowing this?  Is it just to be consistent with
>> the initialisation of structs and arrays?
> 
> What is the point of disallowing it and forcing compiler writers to do
> the additional checking?
> 
>> Are these 3 all equivalent then?
>>
>> int x(10);
> 
> This is a syntax error.
> 
Not in C++.

-- 
Ian Collins.
 




 5 Posts in Topic:
initialising built in types with curly braces
Sard <Sardaukary@[EMAI  2008-04-20 15:03:24 
Re: initialising built in types with curly braces
Barry Schwarz <schwarz  2008-04-20 20:59:49 
Re: initialising built in types with curly braces
Ian Collins <ian-news@  2008-04-21 16:02:29 
Re: initialising built in types with curly braces
Ron Natalie <ron@[EMAI  2008-04-23 08:17:10 
Re: initialising built in types with curly braces
Jerry Coffin <jcoffin@  2008-05-04 13:33:10 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
localhost-V2008-12-19 Wed Jan 7 13:08:48 PST 2009.