delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/07/02/15:01:38

From: "Tim \"Zastai\" Van Holder" <zastai AT hotmail DOT com>
Newsgroups: comp.os.msdos.djgpp
References: <8jm69n$tj0$1 AT nnrp1 DOT deja DOT com>
Subject: Re: SIGSEGV error when reading a file into an array
Lines: 11
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
Message-ID: <9bM75.81426$NF5.1365696@afrodite.telenet-ops.be>
Date: Sun, 02 Jul 2000 18:51:49 GMT
NNTP-Posting-Host: 213.224.63.5
X-Trace: afrodite.telenet-ops.be 962563909 213.224.63.5 (Sun, 02 Jul 2000 20:51:49 MET DST)
NNTP-Posting-Date: Sun, 02 Jul 2000 20:51:49 MET DST
Organization: Pandora - Met vlotte tred op Internet
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hi,

From what I can see, you're using indices starting from 1, while in C arrays
start at index 0. So when you try to enter data from the last row/column
into the array, you write into unallocated memory, which generally triggers
a SIGSEGV.

Zastai



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019