I have a class called Cal and it's .cpp and .h counterpart
Headerfile has
class Cal {
private:
int wa[2][2];
public:
void do_cal();
};
.cpp file has
#include "Cal.h"
void Cal::do_cal() {
print(wa) // where print just itterates and prints the elements in wa
}
My question is how do I initialize the array wa
? I just can't seem to get it to work.
I tried with :
int wa[2][2] = {
{5,2},
{7,9}
};
in the header file but I get errors saying I cant do so as it's against iso..something.
Tried also to initialize the array wa
in the constructor but that didnt work either.. What am I missing ?
Thanks