I define an array called "matriu":
#include "CQix.h"
#include "Graphics_Console.h"
class cTauler
{
CQix Qix;
HANDLE hScreen;
int iniciX, iniciY, fiX, fiY;
private:
bool matriu[38][28];
int area_activa;
};
And I want to initialize all values to false:
void cTauler::InicialitzarTauler()
{
int i,j;
for(i=0;i<=fiX+2;i++)
{
for(j=0;i<=fiY+2;j++)
{
matriu[i][j]=false;
}
}
But when I compile i get this error: 0xC0000005: Access violation.
So i tried to define the array doing this:
bool matriu[38][28]= {false};
And I can't compile because: "not allowing data member initializer"
What can I do? Thanks.
If the data matriu[38][28] is going to be always the same size, consider creating const static classmembers fiX and fiY and initialize them to values 38 and 28. You have probably not initialized them correctly...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With