Delphi to C++ types mapping

From RAD Studio
Jump to: navigation, search

Go Up to Support for Delphi Data Types and Language Concepts


Below you can find a list of Delphi data types and the corresponding C++ data types:

Delphi type defined in sysmac.h Platform Corresponding C++ type

Boolean

System::Boolean

bool

ShortInt

System::Int8

signed char

SmallInt

System::SmallInt

short

Integer

System::Integer

int

Int64

System::Int64

__int64

Byte

System::Byte

unsigned char

Word

System::Word

unsigned short

Cardinal

System::Cardinal

unsigned

UInt64

System::UInt64

unsigned __int64

(unsigned long long)

NativeInt System::NativeInt 32-bit platforms int
64-bit platforms __int64
NativeUInt System::NativeUInt 32-bit platforms unsigned int
64-bit platforms unsigned __int64
LongInt

System::Longint

32-bit platforms
64-bit Windows
int
64-bit POSIX Platforms long
LongWord 32-bit platforms
64-bit Windows
unsigned
64-bit POSIX Platforms unsigned long

FixedInt

int

FixedUInt

unsigned int

Single

System::Single

float

Double

System::Double

double

Extended

System::Extended

long double

Currency

System::Currency, System::CurrencyBase

Comp

System::Comp, System::CompBase

Real

double
Note: The mapping assumes {$REALCOMPATIBILITY OFF}

ShortString

System::ShortString, System::ShortStringBase

OpenString

System::OpenString

char* const
String System::UnicodeString
WideString System::WideString
AnsiChar char
Char System::WideChar Windows platforms wchar_t
POSIX platforms char16_t
WideChar System::WideChar Windows platforms wchar_t
POSIX platforms char16_t

File

System::file

Text

System::TextFile

ByteBool

System::ByteBool

unsigned char

WordBool

System::WordBool

unsigned short

LongBool

System::LongBool

int

Real48

not supported in C++

Pointer

void*

PWideChar

System::WideChar*

Windows platforms wchar_t*
POSIX platforms char16_t*

PAnsiChar

char*

Variant

System::Variant defined in sysvari.h

OleVariant

System::OleVariant defined in sysvari.h

Note: 32-bit platforms include 32-bit Windows and Android.
POSIX platforms supported by C++ include iOS, Android, and Linux.

See Also