"Segmentation fault"

Discussion in 'OT Technology' started by hurleyint1386, Apr 21, 2005.

  1. hurleyint1386

    hurleyint1386 Someone has sand in their vagina

    Joined:
    Jan 6, 2005
    Messages:
    3,687
    Likes Received:
    0
    Location:
    Rochester, NY
    ok, so i'm writing a program with gcc that is basically a 2d (or 3d i dont remember; format is array[][]) and it compiles fine, but when i run it, i get a "Segmentation fault" error. i dont have another compiler to test this with, so i'm not sure if it's gcc or there's a run error. any suggestions? (by the way, im still some what new to gcc, so im not sure if it's that or not)
     
  2. skinjob

    skinjob Active Member

    Joined:
    Jan 6, 2001
    Messages:
    2,337
    Likes Received:
    0
    Location:
    Aztlán
    It's not gcc. It's a runtime error caused when you try to access memory you weren't supposed to. Most likely, you went outside the array bounds. Doublecheck your array indices and make sure they stay within the max indices.
     
  3. samm

    samm Next in Line

    Joined:
    Dec 22, 2000
    Messages:
    2,630
    Likes Received:
    0
    Location:
    San Jose, CA
    post the code here so we can help you debug it
     

Share This Page