initialize class array member

Joined
Jul 6, 2007
Messages
1
Reaction score
0
Hi.

I have problem with initialize array class member as under:
class MyClass
{
public:
MyClass();
~MyClass();
protected:
std::string commands[]; // array of commands
};

std::string MyClass::commands[]={"first","second","third"};

How can I do something like above ???

Thx for help ;)
 

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

Forum statistics

Threads
474,073
Messages
2,570,539
Members
47,197
Latest member
NDTShavonn

Latest Threads

Top