Article View: be.comp.programming
Article #2321Re: [C++] fwrite + segmentation fault
From: MaG
Date: Mon, 19 Jul 2004 22:38
Date: Mon, 19 Jul 2004 22:38
33 lines
2656 bytes
2656 bytes
"Nicolas Barbier" <reply@in.group.invalid> schreef in bericht news:40fba9ab$0$8988$6c56d894@feed0.news.be.easynet.net... > MaG wrote: > > > Null is niet altijd gelijk aan 0, hangt van de implementatie af. > > (NULL == 0) is implementatie-onafhankelijk steeds true. De mogelijke > definities voor NULL zijn (void *) 0 en gewoon 0. > "The language definition states that for each pointer type, there is a special value--the ``null pointer''--which is distinguishable from all other pointer values and which is ``guaranteed to compare unequal to a pointer to any object or function.'' That is, the address-of operator & will never yield a null pointer, nor will a successful call to malloc. (malloc does return a null pointer when it fails, and this is a typical use of null pointers: as a ``special'' pointer value with some other meaning, usually ``not allocated'' or ``not pointing anywhere yet.'') As mentioned above, there is a null pointer for each pointer type, and the internal values of null pointers for different types may be different. Although programmers need not know the internal values, the compiler must always be informed which type of null pointer is required, so that it can make the distinction if necessary." Dus NULL is niet noodzakelijk 0 en je wordt niet geacht de waarde van de NULL pointer te kennen. Gebruik altijd NULL zou ik zo zeggen. ;-) --- MaG
Technical Details
Message-ID:
<C3YKc.664$dO1.199895245@hebe.telenet-ops.be>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!easynews.net!easynet-isham!easynet.net!feed1.news.be.easynet.net!ossa.telenet-ops.be!hebe.telenet-ops.be.POSTED!not-for-mailReferences:
<6euaf0th4h3ctr13l2lk2se4lmbu39ueu6@4ax.com> <wfzJc.186138$XZ1.8812637@phobos.telenet-ops.be> <n3tdf018psossgbcc1ohrcgo8kbk3kastb@4ax.com> <tjEJc.1465$Ci.295274988@hestia.telenet-ops.be> <40fba9ab$0$8988$6c56d894@feed0.news.be.easynet.net>Show Full Headers
Complete Article Headers
X-Google-Thread: fcea4,33ec3f0617e4db5 X-Google-Attributes: gidfcea4,public X-Google-Language: ENGLISH,ASCII-7-bit Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!easynews.net!easynet-isham!easynet.net!feed1.news.be.easynet.net!ossa.telenet-ops.be!hebe.telenet-ops.be.POSTED!not-for-mail From: "MaG" <nomail@nowhere.com> Newsgroups: be.comp.programming References: <6euaf0th4h3ctr13l2lk2se4lmbu39ueu6@4ax.com> <wfzJc.186138$XZ1.8812637@phobos.telenet-ops.be> <n3tdf018psossgbcc1ohrcgo8kbk3kastb@4ax.com> <tjEJc.1465$Ci.295274988@hestia.telenet-ops.be> <40fba9ab$0$8988$6c56d894@feed0.news.be.easynet.net> Subject: Re: [C++] fwrite + segmentation fault Lines: 35 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Message-ID: <C3YKc.664$dO1.199895245@hebe.telenet-ops.be> Date: Mon, 19 Jul 2004 22:38:26 GMT NNTP-Posting-Host: 81.164.156.83 X-Complaints-To: abuse@telenet.be X-Trace: hebe.telenet-ops.be 1090276706 81.164.156.83 (Tue, 20 Jul 2004 00:38:26 CEST) NNTP-Posting-Date: Tue, 20 Jul 2004 00:38:26 CEST Organization: Telenet Internet