C# 프로그래머가 C++을 학습하면서 C#에서와 동일한 데이터 형식을 유지하려고합니다. 나는 이것을 도와야하는 헤더 파일을 썼다. 내가 옳은지 알고 싶습니다.C++ 데이터 형식과 C# 데이터 형식 비교
// boolean
//#DEFINE bool char
//#DEFINE true 0x01
//#DEFINE false 0x00
// 8-bit integers
#DEFINE byte unsigned char
#DEFINE UInt8 unsigned char
#DEFINE Byte unsigned char
#DEFINE sbyte char
#DEFINE Int8 char
#DEFINE SByte char
// 16-bit integers
#DEFINE ushort unsigned short int
#DEFINE UInt16 unsigned short int
#DEFINE short short int
#DEFINE Int16 short int
// 32-bit integers
#DEFINE uint unsigned int
#DEFINE UInt32 unsigned int
//#DEFINE int int
#DEFINE Int32 int
// 64-bit integers
#DEFINE long long long
#DEFINE Int64 long long
#DEFINE ulong unsigned long long
#DEFINE UInt64 unsigned long long
// 32-bit floating point
//#DEFINE float float
#DEFINE Single float
// 64-bit floating point
//#DEFINE double double
#DEFINE Double double
사용 타입 정의로 정의하지 발생합니다. 나는 double이 64 비트가 될 것이라고는 생각하지 않는다. (나는 GCC가 96을 사용한다고 생각한다.) – chris
다른 개발자가이 코드에 대해 작업 할 가능성이있는 경우 표준 C++ 유형을 배우는 시간을 투자 해보십시오. – TheEvilPenguin
고정 폭 유형을 원한다면 [cstdint] (http://en.cppreference.com/w/cpp/types/integer) (또는 [boost] (http://www.boost.org) /doc/libs/release/libs/integer/doc/html/boost_integer/cstdint.html) 비 C++ 11 컴파일러/라이브러리 용 구현). – Mankarse