By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,897 Members | 1,969 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,897 IT Pros & Developers. It's quick & easy.

static const array initialization

P: 1
Does anybody know whow to initialize static const array element by element?

Something like this: Is there any workaround?

class C
{
static const char c[ 3 ];
};

const char C::c[ 0 ] = 1;
const char C::c[ 1 ] = 546;
const char C::c[ 2 ] = 34;

thanks
Simon
Feb 21 '07 #1
Share this Question
Share on Google+
1 Reply


Banfa
Expert Mod 5K+
P: 8,916
Expand|Select|Wrap|Line Numbers
  1. const char C::c[3] = {1, 546, 34};
  2.  
Feb 21 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.