-9

I am trying to finish an assignment for my C programming class on Xcode. It's simple. It reads a text file, which contains a list of student IDs and their test scores. And then it calculates the overall score based on these data, and writes them to another text file. However, I keep getting this Bad Access error message that says:

Thread 1: EXC_BAD_ACCESS(code=1, address=0x7fff00000de4)

I don't know what it means. What should I do?

unkulunkulu
  • 11,576
  • 2
  • 31
  • 49
Haoyao Chen
  • 11
  • 1
  • 1
  • 1
  • 2
    The code is accessing a memory location it should not. Please post the code if you want people to help. – hmjd Apr 15 '13 at 07:19
  • This is not enough to help you! Put some break points where u read the file contents & see where it crashes. Post some code for reference – hp iOS Coder Apr 15 '13 at 07:20
  • Put break points to track where it crash and post your crashing code here. – Mani Apr 15 '13 at 07:28
  • 1
    You should start by googling EXC_BAD_ACCESS; the first hit is http://loufranco.com/blog/understanding-exc_bad_access – Jim Balter Apr 15 '13 at 07:30

1 Answers1

5

The EXC_BAD_ACCESS means that you tried to attempt the incorrect address in memory.

You should start with the following:

  1. Check that all pointers are initialized before using
  2. If you have an array, so possibly you are trying to access the element that is out of bounds

And of course, use the debugger.

Alex
  • 9,891
  • 11
  • 53
  • 87