Einzelnen Beitrag anzeigen

Mikkey

Registriert seit: 5. Aug 2013
265 Beiträge
 
#3

AW: C++ pointer to byte array --> Delphi

  Alt 2. Dez 2013, 06:42
In C Pointer and Array are nearly the same.

So k[0] and *k lead to the same expression that is the character at the place where k points to.

char in C is defined as signed, so unsigned makes sense.

Translation to Delphi could be:

Delphi-Quellcode:
var v: Integer; {k: array of Shortint;}
begin
  v := 0;
  a := a + k(v] + 256*Byte(k[v+1]);
  v := v + 12;
end;
  Mit Zitat antworten Zitat