Article View: borland.public.cppbuilder.nativeapi
Article #14691Re: Corrupted memory?
From: Remy Lebeau (TeamB)
Date: Wed, 06 Aug 2003 19:50
Date: Wed, 06 Aug 2003 19:50
24 lines
1631 bytes
1631 bytes
"Eugene Mayevski" <mayevski@eldos.org> wrote in message news:3f313a1a@newsgroups.borland.com... > In Delphi you need to pass not > > p : pointer; > ReceiveBuf(p, 4); > > but ReceiveBuf(p^, 4); That is not correct. The first is the correct way, assuming the pointer is pointing to actual memory at the time of calling ReceiveBuf(). > in C++ it might be necessary to call > > char* mem = (char*) malloc(5); > Socket->ReceiveBuf(*mem, 4); That is not correct, either. Passing 'mem' without dereferencing it is the correct way. Gambit
Technical Details
Message-ID:
<3f315a92$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!216.166.71.118.MISMATCH!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<3f306c8f@newsgroups.borland.com> <3f313a1a@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,6183e4bd87974955 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-08-06 12:50:05 PST From: "Remy Lebeau \(TeamB\)" <gambit47@yahoo.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3f306c8f@newsgroups.borland.com> <3f313a1a@newsgroups.borland.com> Subject: Re: Corrupted memory? Date: Wed, 6 Aug 2003 12:50:37 -0700 Lines: 26 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 207.175.226.26 Message-ID: <3f315a92$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1060199058 207.175.226.26 (6 Aug 2003 12:44:18 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!216.166.71.118.MISMATCH!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail