cannot find my mistake (c++)
Go to solution
Solved by MisterWhite,
Solved: i deleted my allocated memory before even using it.
Next mistake is here: i get the same mistake code:
for(int i=0; i<counter; i++) { int x=startX[i], y=startY[i]; for(int j=startX[i]; j<endX[i]; j++)// from startX until endX { for(int k=startY[i]; k<endY[i]; k++)// from startY to endY { if(mode[i]=="turn on") beatNeighbour[x][y]=1; else if (mode[i]=="turn off") beatNeighbour[x][y]=0; else if(mode[i]=="toggle") { if(beatNeighbour[x][y]==0) beatNeighbour[x][y]=1; else if( beatNeighbour [x][y]==1) beatNeighbour[x][y]=0; } y++; } x++; } }

Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now