![]() |
Delphi-Version: 5
CPP -> Delphi
wie würdet ihr die Folgende Zeile Übersetzen mich verwirrt sie etwas
Code:
for (b = ~b & 0x3FFFFFFF; a >= 8; a -= 8, buffer++)
|
AW: CPP -> Delphi
Code:
Vielleicht so:
for (b = ~b & 0x3FFFFFFF; a >= 8; a -= 8, buffer++)
Delphi-Quellcode:
var
buffer, a, b: integer; begin b := (not b) and $3FFFFFFF; while a >= 8 do begin ... Dec(a,8); Inc(buffer); end; end; |
AW: CPP -> Delphi
buffer ist ziemlich sicher kein Integer. Vermutlich PAnsiChar oder sowas ...
|
AW: CPP -> Delphi
Zitat:
|
AW: CPP -> Delphi
Zitat:
|
AW: CPP -> Delphi
Danke ihr beiden,
Assarbad hat recht ist ein PAnsiChar und wie übersetz ich das
Code:
if ( ((a ^ data) & (1L << 29)) != 0 )
Delphi-Quellcode:
so in etwa?
var
ll : LongInt; if not((a Xor data) and (SizeOf(ll) SHL 29)) = 0 then |
AW: CPP -> Delphi
Zitat:
Delphi-Quellcode:
if ((a xor data) and (1 shl 29)) <> 0 then
|
AW: CPP -> Delphi
sizeof longint ist 1??
|
AW: CPP -> Delphi
Also doch richtig?
|
AW: CPP -> Delphi
Das L kannst'e in Delphi ignorieren.
Und um deine letzte Frage zu beantworten: Wieviele Bytes ist ein LongInt groß? |
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:52 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz