From: T DOT Harte AT btinternet DOT com (Thomas Harte) Newsgroups: comp.os.msdos.djgpp Subject: Re: SIGSEGV for unknown reason in wireframe drawer Date: Mon, 18 Aug 1997 23:57:55 GMT Organization: BT Internet Lines: 15 Message-ID: <33f8e13e.14787087@news.btinternet.com> References: <33E5EFDF DOT 580EEEE0 AT mwci DOT net> <19970817202000 DOT QAA05699 AT ladder02 DOT news DOT aol DOT com> NNTP-Posting-Host: host5-99-62-4.btinternet.com To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk On 17 Aug 1997 20:20:35 GMT, gingko69 AT aol DOT com (Gingko 69) wrote: >>> for( curr_vertex=0; curr_vertex < the_object->num_points; >>> curr_vertex++) > >Try the_object->num_points - 1. In your object the first vertex is [0], >the second [1] and so on, so you are eventually accessing one vertex that >doesn't exist. Surely that isn't true since the compiler is parsing the final one that does exist, adding one to curr_vertex, finding it is no longer below the_object->num_points, and so ending the loop before parsing vertex [the_object->num_points] ? -Thomas