[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [CPROG] Kode der aldrig bliver kxrt?



On Thu, 17 Aug 2000, Niels Træholt Franck wrote:
> > Nej det er ikke en bug - et int array på [2] er 0,1 og 2 - da plads [2]
> > ikke behøver at være NULL (læs '\0') da '\0' er NULL = 0, derfor er det
> > ikke en bug.
>
> Et array på [2] er et array med 2 pladser: 0 og 1 *. Plads nr [2] er
> derfor ugyldig. At dit program virker skyldes at C ikke tjekker om
> man læser/skriver uden for et array. Så længe man ikke overskriver
> noget vitalt (andre variable eller programkode) så virker det.
>
> Niels
>
> * ifølge dansk version af The C programming Language: Ansi C af
> B W Kernighan og D M Ritchie

der findes et værktøj der hedder checker, det kan hentes fra GNU
http://www.gnu.org/software/checker/checker.html

Når det er installeret kan du oversætte med -lchecker, så skulle fejlen blive 
fundet.

-anders


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:08 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *