LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   I keep getting a bus error, please help! (https://www.linuxquestions.org/questions/programming-9/i-keep-getting-a-bus-error-please-help-668193/)

Nauntilus 09-07-2008 03:59 PM

I keep getting a bus error, please help!
 
I am working on a program that is using a dynamically allocated array. I have determined that the bus error came from this piece of code.

for ( int i = 0; i < (rows-1); i++)
{

for ( int j = 0; j < (colmn-1); j++ )
{
arrGrid[i][j] = 0;

}

}

But I am not sure what I am doing wrong. Please help if you know what the problem is. It seems that the outside for loop is what is causing the problem, and I am not sure why.

JaseyJaseJase 09-07-2008 05:52 PM

Hi nauntilus

Could you post the method you're using to create the dynamic array

J

graemef 09-07-2008 10:23 PM

what is the value of row, column and how is arrGrid allocated?


All times are GMT -5. The time now is 12:44 AM.