now i am trying to declare a char[][] like this:
Granery::foodNames[5][100] = {"Meat","Fruit","Wheat","Vegetables","Dairy"};
while in the header i have:
- #ifndef Granery_h
-
#define Granery_h
-
class Granery
-
{
-
public:
-
Granery();
-
static char foodNames[5][100];
-
};
-
#endif
when i compile this i get an error :
[C++ Error] Granery.cpp(5): E2188 Expression syntax
that error is on the line in the .cpp code
Granery::foodNames[5][100] = {"Meat","Fruit","Wheat","Vegetables","Dairy"};
i have also tried:
Granery::foodNames = {"Meat","Fruit","Wheat","Vegetables","Dairy"};
any help with how i shud be initializing the char[][]?
thanks,
ken