How many bytes in the long double with TDM-GCC x64 4.8.1?
How many will I get to use under 32 bit XP?
Are there any specs to be found on this compiler?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
A 32-bit long double is 12 bytes, a 64-bit long double is 16 bytes. A 32-bit nullptr is 4 bytes, a 64-bit nullptr is 8 bytes. Those are the only two fundamental data types that appear to have differing bytes sizes depending on 32/64-bit compilation.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Type the following code into a new C++ project and compile it either as 32-bit or 64-bit. When you run the program you will see the byte sizes for the fundamental data types in C++.
#include<iostream>#include<conio.h>usingstd::cout;intmain(){cout<<"The fundamental data types in C++:\n\n";cout<<"Integer types:\n";cout<<"The size of a char is:\t\t"<<sizeof(char)<<" byte(s).\n";cout<<"The size of a wchar_t is:\t"<<sizeof(wchar_t)<<" byte(s).\n";cout<<"The size of a short int is:\t"<<sizeof(short)<<" byte(s).\n";cout<<"The size of an int is:\t\t"<<sizeof(int)<<" byte(s).\n";cout<<"The size of a long int is:\t"<<sizeof(long)<<" byte(s).\n";cout<<"The size of a long long int is:\t"<<sizeof(longlong)<<" byte(s).\n\n";cout<<"Floating point types:\n";cout<<"The size of a float is:\t\t"<<sizeof(float)<<" byte(s).\n";cout<<"The size of a double is:\t"<<sizeof(double)<<" byte(s).\n";cout<<"The size of a long double is:\t"<<sizeof(longdouble)<<" byte(s).\n\n";cout<<"Character types:\n";cout<<"The size of a char is:\t\t"<<sizeof(char)<<" byte(s).\n";cout<<"The size of a wchar_t is:\t"<<sizeof(wchar_t)<<" byte(s).\n";cout<<"The size of a char16_t is:\t"<<sizeof(char16_t)<<" byte(s).\n";cout<<"The size of a char32_t is:\t"<<sizeof(char32_t)<<" byte(s).\n\n";cout<<"Boolean type:\n";cout<<"The size of a bool is:\t\t"<<sizeof(bool)<<" byte(s).\n\n";cout<<"Null pointer type:\n";cout<<"The size of a nullptr is:\t"<<sizeof(nullptr)<<" byte(s).";_getch();return0;}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
How many bytes in the long double with TDM-GCC x64 4.8.1?
How many will I get to use under 32 bit XP?
Are there any specs to be found on this compiler?
A 32-bit long double is 12 bytes, a 64-bit long double is 16 bytes. A 32-bit nullptr is 4 bytes, a 64-bit nullptr is 8 bytes. Those are the only two fundamental data types that appear to have differing bytes sizes depending on 32/64-bit compilation.
Type the following code into a new C++ project and compile it either as 32-bit or 64-bit. When you run the program you will see the byte sizes for the fundamental data types in C++.