🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: nl.comp.programmeren
Article #228

Re: Lijnen tellen van een project

#228
From: Stef
Date: Tue, 01 Feb 2005 09:10
26 lines
2284 bytes
In nl.comp.programmeren,
Sjoerd A. Schreuder <sa_schreuder@wanadoo.nl> wrote:
>
>Ik ken C99 niet goed genoeg, maar ik neem aan dat:
>   mytype_t *x = malloc(sizeof(mytype_t));
>nog steeds mogelijk is (anders te veel code oncompileerbaar).
>Maar dat betekent dat het returntype van malloc(), (void*) of (char*)
>of wat dan ook, zonder cast naar (mytype_t*) moet zijn om te zetten.
>
Ja, de cast is in C niet noodzakelijk en wordt o.h.a. afgeraden.
Belangrijkste argument is dat een vergeten "#include <stdlib.h>" met de
cast geen foutmelding geeft en zonder de cast juist wel. Doorzoek anders
comp.lang.c eens op "never cast the return value of malloc".

>Als mijn aanname over C juist is, dan zit er dus wel degelijk een
>groot verschil tussen C en C++ op dit punt.
>
Klopt en C++ code zit dan ook vol met die ergerlijke casts. En ook C
code die door een C++ compiler gehaald wordt.


-- 
Stef    (remove caps, dashes and .invalid from e-mail address to reply by mail)

	A farm in the country side had several turkeys, it was known as the
house of seven gobbles.
Technical Details
Message-ID: <4e056$41ff477c$54f63171$2540@publishnet.news-service.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!news-in.ntli.net!newsrout1-win.ntli.net!ntli.net!border2.nntp.ams.giganews.com!nntp.giganews.com!feeder.news-service.com!post.news-service.com!publishnet.news-service.com!not-for-mail
References: <%XJId.2415$OZ2.252982@phobos.telenet-ops.be> <ct9k2f.4js.1@news.isolution.nl> <IAzIFp.1qJ@vulcan.xs4all.nl> <41fa3d30$0$96924$abc4f4c3@news.wanadoo.nl> <IB6JF0.2FL@vulcan.xs4all.nl> <y6CdnR8nao-u5GPcRVnyvA@casema.nl> <41fedd9a$0$30144$abc4f4c3@news.wanadoo.nl>

Show Full Headers
Complete Article Headers
X-Google-Thread: 107324,ab34a8b99e320381
X-Google-Thread: fcea4,ab34a8b99e320381
X-Google-Attributes: gid107324,gidfcea4,public
X-Google-Language: DUTCH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!news-in.ntli.net!newsrout1-win.ntli.net!ntli.net!border2.nntp.ams.giganews.com!nntp.giganews.com!feeder.news-service.com!post.news-service.com!publishnet.news-service.com!not-for-mail
From: stef33d@yahooI-N-V-A-L-I-D.com.invalid (Stef)
Newsgroups: nl.comp.programmeren,be.comp.programming
Subject: Re: Lijnen tellen van een project
References: <%XJId.2415$OZ2.252982@phobos.telenet-ops.be> <ct9k2f.4js.1@news.isolution.nl> <IAzIFp.1qJ@vulcan.xs4all.nl> <41fa3d30$0$96924$abc4f4c3@news.wanadoo.nl> <IB6JF0.2FL@vulcan.xs4all.nl> <y6CdnR8nao-u5GPcRVnyvA@casema.nl> <41fedd9a$0$30144$abc4f4c3@news.wanadoo.nl>
Organization: None
User-Agent: slrn/0.9.6.4 (Linux)
Message-ID: <4e056$41ff477c$54f63171$2540@publishnet.news-service.com>
X-Complaints-To: abuse@news-service.com
Date: Tue, 01 Feb 2005 10:10:20 +0100
Lines: 26
NNTP-Posting-Host: 84.246.49.113 (84.246.49.113)
NNTP-Posting-Date: Tue, 01 Feb 2005 10:10:20 +0100
X-Trace: 4e05641ff477cf15394d402540