So what I have in the first post is correct as far as passing the array?
If so, then it still has a runtime error.
Printable View
So what I have in the first post is correct as far as passing the array?
If so, then it still has a runtime error.
Once I added &, I don't get a runtime error here. Of course, I commented out print_array and multiply_array, since you don't seem to have those written.
If I comment out the read_array call and the ia, ib declarations in main() I run fine but for some reason when I have it uncommented as how I posted in the initially it causes the runtime error.
I use Microsoft Visual Studio 2008 Express Edition. -.-
Any suggestions why I would be getting the runtime error?
So ... what runtime error do you get? (And you did put &array1[i][j], right?)
Yep, I did.
Unhandled exception at 0x00c017e7 in Lab8.exe: 0xC00000FD: Stack overflow.
Unhandled exception at 0x00c017e7 in Lab8.exe: 0xC0000005: Access violation reading location 0x00030000.
This is what I get when I debug.
I can't see anything in what you've posted. Granted, what you've posted is not compilable, so I know it's not the code you're running. What code are you running?
I am not sure I understand what you are saying but this is the code I am running. If you require a screenshot of some sort let me know. Also do you have an Instant Messenger of some kind, if that is too personal we can stick to this thread.
At this point in time I commented out the inputting from the .txt file just for trying to figure out the runtime error issue.
Alright, so you got rid of print_array completely.
Going through it with debugger, it is choking on creating two 500x500 matrices. Changing max rows and max columns to 100 made everything work. Apparently 500,000 integers is more than your stack can handle.
Ah. Well get this, I changed the declarations in main() of ia and ib to
and it worked, but then I also changed the NUM_ROW and NUM_COLUMN to 250 without the static as you proved how much my stack could handle. Funny how in my programming class we used 1024 by 1024. Perhaps it is the express edition...hrm I may have to look into that.Code:static int ia[NUM_ROW][NUM_COLUMN];
Not sure if the static part is even correct though ;)