Convert one delphi code line to c++

Posted by user1332636 on Stack Overflow See other posts from Stack Overflow or by user1332636
Published on 2012-04-13T23:24:18Z Indexed on 2012/04/13 23:29 UTC
Read the original article Hit count: 117

Filed under:
|
|

How can I write that line in c++?

This is the code in delphi

type
 TSettings = record
    sFileName: String[50]; 
    siInstallFolder: Byte; 
    bRunFile: Boolean;
   ...
  end;

..
var
i: dword;
sZdData: PChar;
Settings :Tsettings;
begin
....
     ZeroMemory(@Settings, sizeof(Tsettings));
      settings := Tsettings(Pointer(@sZdData[i])^); // this code to c++

c++ code (hope the rest is OK)

struct TSettings{
    char sFileName[50]; 
    byte siInstallFolder; 
    bool bRunFile;
   ...
}  Settings;

...
DWORD i;
LPBYTE sZdData;

         ZeroMemory(&Settings, sizeof(TSettings));
      Settings = ????? // im failing here i dunno what to do // i need same as in delphi code above

© Stack Overflow or respective owner

Related posts about c++

Related posts about delphi