Hello, this should be simple, but I'm unsure of the correct syntax for initializing an array from a constructor. Consider :
I'm not sure what the right syntax is for the initializer, but the compiler doesn't seem to like this. Any ideas?
Thanks.
Code:
class Firable {
public:
Firable (int wid_first, int wid_second, int wid_third)
: wids ( {wid_first, wid_second, wid_third} )
{
/* ... */
}
private:
int wids [3];
};
I'm not sure what the right syntax is for the initializer, but the compiler doesn't seem to like this. Any ideas?
Thanks.