Invalid Memory Reference

Write here if you have problems with your C source code

Moderator: Board moderators

Post Reply
Sneeze
New poster
Posts: 13
Joined: Thu Jan 30, 2003 4:04 am

Invalid Memory Reference

Post by Sneeze »

Some of my programs work well in my computer, but I will get a "Invalid Memory Reference" crash message. What does it mean? How could I fixed the problem? :cry:
..
A great helper
Posts: 454
Joined: Thu Oct 18, 2001 2:00 am
Location: Hong Kong

Post by .. »

Mostly because your program isn't correct. When the judge use some test cases to test your program, your program can't handle it correctly and get segmentation fault.

Also, are you sure your program reading input correctly? Is the problem you are solving in the multiple input format?
My signature:
  • Please make discussion about the algorithm BRFORE posting source code.
    We can learn much more in discussion than reading source code.
  • I HATE testing account.
  • Don't send me source code for debug.
Sneeze
New poster
Posts: 13
Joined: Thu Jan 30, 2003 4:04 am

The discription of the problems

Post by Sneeze »

Sometimes the description of the problems really confuses me. For example, q477 should be a very easy one; after I enlarged my array size (for example, double something[10000]), I got "accepted" response. However, the description didn't mention it would be rejudged. Insted, it clearly mentioned there would be 10 sets of data. I thought I got a lesson. But is it necessary to ignore some part of the description and expand my array size? :roll:
Last edited by Sneeze on Sat Feb 01, 2003 2:56 pm, edited 1 time in total.
..
A great helper
Posts: 454
Joined: Thu Oct 18, 2001 2:00 am
Location: Hong Kong

Post by .. »

For that problem, I just declare an array of size 10 to hold the data.
If you get accepted after declaring a largesr size, I think you got array index out of bound somewhere in your program.........
My signature:
  • Please make discussion about the algorithm BRFORE posting source code.
    We can learn much more in discussion than reading source code.
  • I HATE testing account.
  • Don't send me source code for debug.
Post Reply

Return to “C”