Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > initialiser list

Reply
Thread Tools

initialiser list

 
 
Fraser Ross
Guest
Posts: n/a
 
      12-24-2010
Can someone explain why there is an error "} expected" for this?

char MyArray1[2] = { "a"[0], 'b' };

Fraser.


 
Reply With Quote
 
 
 
 
Fraser Ross
Guest
Posts: n/a
 
      12-24-2010
"Fraser Ross"
> Can someone explain why there is an error "} expected" for this?
>
> char MyArray1[2] = { "a"[0], 'b' };
>
> Fraser.



I see what there is now. There isn't list-initialisation. The char
array is seen to be initialised from the array "a". The braces are
irrelevant.

Fraser.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
array initialiser list, order of initialisation kwikius C++ 11 07-11-2008 08:06 PM
Reference + initialiser oddity. Glen Able C++ 3 01-29-2005 01:21 AM
Why no non-integral static const initialiser's within class definition? Mike Hewson C++ 14 01-07-2005 08:43 AM
Dereferencing this in constructors initialiser list Martin Zimmermann C++ 2 04-14-2004 02:07 PM
calling member functions from an initialiser list John Harrison C++ 2 06-25-2003 06:25 PM



Advertisments