Einzelnen Beitrag anzeigen

WojTec

Registriert seit: 17. Mai 2007
482 Beiträge
 
Delphi XE6 Professional
 
#1

C++ pointer to byte array --> Delphi

  Alt 1. Dez 2013, 19:47
Delphi-Version: 2010
There is definition in function header:

Code:
unsigned char *k
Then inside while loop there is:

Code:
a += ( k[0] + ( (unsigned)k[1] << 8 )) .........
k += 12;
If k is increased, then what mean k[%d] in every iteration? Isn't it first byte from data, but first byte from every 12 bytes package, I think?

In Delphi should be:

Code:
v := 0;
k[v + 1], +2, etc
inc(v, 12);
?

And what mean typecasting to unsigned, when char in C++ is just byte?

Geändert von WojTec ( 1. Dez 2013 um 19:51 Uhr)
  Mit Zitat antworten Zitat