static initialization of array members?

J

Jonathan Mcdougall

Peter said:
Is this possible in C++ ???

Please, don't write parts of your question in your subject. Make sure
everything is in your post.

Of course it is possible to initialize static array members, it is even
mandatory.

class C
{
public:
static int a[10];
};

int C::a[10] = {1, 2, 3};


Jonathan
 
M

mlimber

Jonathan said:
Please, don't write parts of your question in your subject. Make sure
everything is in your post.

Of course it is possible to initialize static array members, it is even
mandatory.

I think he meant statically initializing arrays that are members.

Cheers! --M
 
P

Peter Olcott

Jonathan Mcdougall said:
Peter said:
Is this possible in C++ ???

Please, don't write parts of your question in your subject. Make sure
everything is in your post.

Of course it is possible to initialize static array members, it is even
mandatory.

class C
{
public:
static int a[10];
};

int C::a[10] = {1, 2, 3};


Jonathan

Thanks that did it!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top