error i get

hi,

my code is this:
http://pastebin.com/NvmmpjdB

Windows has triggered a breakpoint in TARGIL4.exe.

This may be due to a corruption of the heap, which indicates a bug in TARGIL4.exe or any of the DLLs it has loaded.

This may also be due to the user pressing F12 while TARGIL4.exe has focus.

The output window may have more diagnostic information.

please advise.

regards
The output window may have more diagnostic information.

Does it?

Are you sure your input file is opening correctly? And are you correctly reading this file correctly?

Have you tried running this program with your debugger? The debugger should be able to tell you where the problem was detected and you should be able to view your variables at the time of the crash.



hi,

i have made to fix this problem but now i get another problem.
my code is:

void sub_picture(int** picR,int shurot,int amudot,int x1,int y1,int x2, int y2)
{
int shurot1=x2-x1;
int amudot1=y2-y1;
int i,j;
int** pic3=new int*[shurot1+1];
for (int x=x1,i=0;x<x2+1;i++,x++) //x=ROWS
{
pic3[i]=new int[amudot1+1];
for (int y=y1,j=0;y<y2+1 ;j++,y++)//y=COLS
{
pic3[i][j]=picR[x][y];
}
}
WriteFile("t_5.pgm",pic3,shurot1+1,amudot1+1);
for(int i=0;i<shurot1+1;i++)
{
delete[](pic3[i]);
}
delete[](pic3);
}

the error is :
Unhandled exception at 0x00eec806 in TARGIL4.exe: 0xC0000005: Access violation reading location 0xfdfdff8d.

i understand what the error means but i have no idea what is not good.

just to explain - i try to take a matrix text file, and to cut it with 2 point to more little matrix then the original.

regards

Have you tried running this program with your debugger? The debugger should be able to tell you where the problem was detected and you should be able to view your variables at the time of the crash.

yes,
but my matrix is 400X300 and after pressins F10 hundred times its not geting the error. so i guess its on the high numbers

if i insert short nembers (less then 200) it works..
Topic archived. No new replies allowed.