LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 09-07-2008, 03:59 PM   #1
Nauntilus
Member
 
Registered: Oct 2005
Location: Tempe, AZ
Distribution: Mac OSX, Ubuntu 12.04 LTS
Posts: 132

Rep: Reputation: 17
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.
 
Old 09-07-2008, 05:52 PM   #2
JaseyJaseJase
LQ Newbie
 
Registered: Sep 2008
Posts: 6

Rep: Reputation: 0
Hi nauntilus

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

J
 
Old 09-07-2008, 10:23 PM   #3
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
what is the value of row, column and how is arrGrid allocated?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
internal compiler error: Bus error maxcell Linux - Software 0 03-23-2007 02:45 PM
Bus error bratch Linux - Software 6 07-04-2005 03:56 PM
Bus error? doodykimo Linux - Newbie 2 03-30-2005 04:33 AM
Bus Error? Chu Linux - Newbie 4 12-21-2003 10:42 PM
Bus error linuxanswer Programming 2 11-10-2003 02:38 AM


All times are GMT -5. The time now is 02:43 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration