Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C - C++ Learning > initialising bu...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 5 Topic 4125 of 4218
Post > Topic >>

initialising built in types with curly braces

by Sard <Sardaukary@[EMAIL PROTECTED] > Apr 20, 2008 at 03:03 PM

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?

Are these 3 all equivalent then?

int x(10);
int x =10;
int x ={10};
 




 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
tan12V112 Fri Jul 25 19:35:25 CDT 2008.