Article View: be.comp.programming
Article #5632Re: Delphi en C
From: Serve Laurijssen
Date: Sun, 16 Mar 2003 20:24
Date: Sun, 16 Mar 2003 20:24
35 lines
1881 bytes
1881 bytes
"Ivan Van den Bossche" <ivan.van.den.bossche@pandora.be> wrote in message
news:yW4da.14679$Vq.927@afrodite.telenet-ops.be...
> Hi,
>
> Ik heb een toepassing in Delphi geschreven die ik wens om te zette naar C.
> In de Delphi toepassing maak ik een variable aan:
>
> var
> Buf:array[0..5] of Char;
>
> F:TFileStream;
> F:= TFileStream.Create(InFileName, 0);
> F.ReadBuffer(Buf, SizeOf(Buf));
>
> Hoe zet ik deze instructies om in C?
#include <stdio.h>
int main() {
char buf[5];
FILE *fp = fopen(__FILE__, "r");
if (fp) {
fread(buf, sizeof *buf, sizeof buf / sizeof *buf, fp);
fclose(fp);
}
return 0;
}
Technical Details
Message-ID:
<b52mi3$tva$1@news2.tilbu1.nb.home.nl>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!bnewspeer01.bru.ops.eu.uu.net!emea.uu.net!skynet.be!skynet.be!213.51.129.3.MISMATCH!newshub1.home.nl!home.nl!not-for-mailReferences:
<yW4da.14679$Vq.927@afrodite.telenet-ops.be>Show Full Headers
Complete Article Headers
X-Google-Language: DUTCH,ASCII-7-bit X-Google-Thread: 107324,679d0f365a2c46e6 X-Google-Attributes: gid107324,public X-Google-Thread: fcea4,679d0f365a2c46e6 X-Google-Attributes: gidfcea4,public X-Google-ArrivalTime: 2003-03-16 12:24:48 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!bnewspeer01.bru.ops.eu.uu.net!emea.uu.net!skynet.be!skynet.be!213.51.129.3.MISMATCH!newshub1.home.nl!home.nl!not-for-mail From: "Serve Laurijssen" <oh@ja.nl> Newsgroups: be.comp.programming,nl.comp.programmeren Subject: Re: Delphi en C Date: Sun, 16 Mar 2003 21:24:38 +0100 Organization: @Home Benelux Lines: 37 Message-ID: <b52mi3$tva$1@news2.tilbu1.nb.home.nl> References: <yW4da.14679$Vq.927@afrodite.telenet-ops.be> NNTP-Posting-Host: cp179079-a.tilbu1.nb.home.nl X-Trace: news2.tilbu1.nb.home.nl 1047846275 30698 217.120.117.137 (16 Mar 2003 20:24:35 GMT) X-Complaints-To: abuse@home.nl NNTP-Posting-Date: Sun, 16 Mar 2003 20:24:35 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106