Jericob
Jericob

Reputation: 2097

how to convert data type byte[] in c to delphi?

This is code I need to convert delphi:

LPBYTE readCharBuff = NULL;
BYTE readBuffSize;

readCharBuff = new BYTE[200];
readBuffSize    = 200;

readCharBuff[readBuffSize] = '\0';

Thanks for your help

Upvotes: 2

Views: 723

Answers (1)

Remy Lebeau
Remy Lebeau

Reputation: 596196

Here is a literal translation:

var
  readCharBuff: PByte; 
  readBuffSize: Byte; 

.

readCharBuff := nil; 

GetMem(readCharBuff, 200); 
readBuffSize := 200; 

readCharBuff[readBuffSize] := $0; 

Upvotes: 1

Related Questions