Delphi to C++ types mapping

From RAD Studio
Jump to: navigation, search
  • We can create table headers:

C++    

Delphi

and avoid copying (C++) and (Delphi) for every row...

  • We can segregate the C++ types by origin
  • standard
  • RTL (this is the #1 relation with Delphi here)

I think this can improve visibility.

Vadimb 03:39, 18 August 2011 (PDT)


Here's updated versions for WIN64. Please add a note that "System::*" types are accessible via the <System.hpp> header.

Go Up to Language Support for the RAD Studio Libraries (C++)


Below is a list of Delphi data types and the corresponding C++ data types:

Delphi type Corresponding C++ type

Boolean (Delphi)

System::Boolean, bool (C++)

ShortInt (Delphi)

signed char (C++)

SmallInt (Delphi)

System::SmallInt, short (C++)

Integer (Delphi)

System::Integer, int (C++)

Byte (Delphi)

System::Byte, unsigned char (C++)

Word (Delphi)

System::Word, unsigned short (C++)

Cardinal (Delphi)

System::Cardinal, unsigned (C++)

Int64 (Delphi)

__int64 (C++)

UInt64 (Delphi)

unisgned __int64 (C++)

NativeInt (Delphi)

int (x32), __int64 (x64) (C++)

NativeUInt (Delphi)

unsigned (x32), unsigned __int64 (x64) (C++)

Single (Delphi)

float (C++)

Double (Delphi)

double (C++)

Extended (Delphi)

System::Extended. long double (C++)

Currency (Delphi)

System::Currency, System::CurrencyBase (C++)

Comp (Delphi)

System::Comp, System::CompBase (C++)

Real (Delphi)

NOT SUPPORTED (C++)

ShortString (Delphi)

System::ShortString, System::ShortStringBase (C++)

OpenString (Delphi)

char* const, System::OpenString (C++)

File (Delphi)

System::file, void* (C++)

System::Text, void* (Delphi)

System::TextFile, void* (C++)

ByteBool (Delphi)

System::ByteBool, unsigned char (C++)

WordBool (Delphi)

System::WordBool, unsigned short (C++)

LongBool (Delphi)

unsigned int (C++)

Real48 (Delphi)

not supported in C++

Pointer (Delphi)

void* (C++)

PWideChar (Delphi)

System::WideChar*, wchar_t*(Windows), char16_t*(OSX) (C++)

PAnsiChar (Delphi)

char* (C++)

Variant (Delphi)

System::Variant (C++)

System::OleVariant (Delphi)

System::OleVariant (C++)

LongInt (Delphi)

int (C++)

LongWord (Delphi)

unsigned (C++)

TextFile (Delphi)

System::TextFile, void* (C++)