Question:
Can i initialize char arrays using preamble initialization ?
Code:
#prag...
#pragma once
class Pizza
{
public:
Pizza (const char top[] = "cheese", const int size = 12, const double pr = 8.99)
: strcpy_s (_topping ,top), _diameter (size), _price (pr)
{}
~Pizza () {}
void setValues ();
void displayValues ();
private:
char _topping [20];
int _diameter;
double _price;
};
Error:
error C2614: 'Pizza' : illegal member initialization: 'strcpy_s' is not a base or member