AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren

c++ Variablen in Delphi

Ein Thema von Gehstock · begonnen am 25. Feb 2008 · letzter Beitrag vom 25. Feb 2008
Antwort Antwort
Gehstock

Registriert seit: 28. Jan 2006
Ort: Görlitz / Sachsen
489 Beiträge
 
Delphi 2007 Professional
 
#1

c++ Variablen in Delphi

  Alt 25. Feb 2008, 17:23
gesucht werden

byte* buf_ptr, DWORD& list, ^byte und DWORD *table, unsigned char *buffer,
Marcel
  Mit Zitat antworten Zitat
Dax
(Gast)

n/a Beiträge
 
#2

Re: c++ Variablen in Delphi

  Alt 25. Feb 2008, 17:26
byte* buf_ptr -> buf_ptr: PByte

DWORD& list -> var list: Cardinal

^byte -> sagt mir leider nix

DWORD *table -> table: PCardinal

unsigned char *buffer -> gibts so direkt nicht, am ehesten buffer: PChar
  Mit Zitat antworten Zitat
Gehstock

Registriert seit: 28. Jan 2006
Ort: Görlitz / Sachsen
489 Beiträge
 
Delphi 2007 Professional
 
#3

Re: c++ Variablen in Delphi

  Alt 25. Feb 2008, 17:36
bei einem typ hab ich ein problem

DWORD *table


Delphi-Quellcode:
void CAMSSAnalyzerDlg::make_crc30_table(DWORD *table)
{
    DWORD c;
    int n, k;
       
    for (n = 0; n < 256; n++) {
        c = n;
      c <<= (30-8);
        for (k = 0; k < 8; k++) {
            if ((c & 1<<(30-1)) != 0) {
                c = CRC_30_POLYNOMIAL ^ (c << 1);
            }
 else {
                c <<= 1;
            }

        }
        table[n] = c;
    }
}
hab ich zu übersetzt(Versuch)

Delphi-Quellcode:
Procedure make_crc30_table(table: PCardinal);
var
c : DWord;
n,k : Integer;
begin
    for n := 0 to 255 do
    begin
     c := n;
      c := c shl (30-8);
        for k := 0 to 7 do
         begin
            if not((c and 1 shl (30-1)) = 0) then
                c := CRC_30_POLYNOMIAL xor (c shl 1)
             else
                c := c shl 1;
        end;
        table[n] := c; //Fehler
    end;
end;
Zitat:
Array type Required
Marcel
  Mit Zitat antworten Zitat
Dax
(Gast)

n/a Beiträge
 
#4

Re: c++ Variablen in Delphi

  Alt 25. Feb 2008, 17:40
Jop, DWORD *table lässt sich mit table: PCardinal oder table: array of Cardinal übersetzen.
  Mit Zitat antworten Zitat
Gehstock

Registriert seit: 28. Jan 2006
Ort: Görlitz / Sachsen
489 Beiträge
 
Delphi 2007 Professional
 
#5

Re: c++ Variablen in Delphi

  Alt 25. Feb 2008, 17:42
Danke so gibt es keine Fehler ist die Übersetzung soweit richtig?
Marcel
  Mit Zitat antworten Zitat
Dax
(Gast)

n/a Beiträge
 
#6

Re: c++ Variablen in Delphi

  Alt 25. Feb 2008, 17:48
if not((c and 1 shl (30-1)) = 0) then sollte besser einif (c and (1 shl (30-1)) <> 0 then sein...

edit: ups, verklammert
  Mit Zitat antworten Zitat
Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Ansicht

Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 11:09 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz