FUNDAMENTAL DATA TYPE<\/strong><\/p>\n The values of variables are stored somewhere in an unspecified location in the computer memory as zeros and ones. Our program does not need to know the exact location where a variable is stored; it can simply refer to it by its name. What the program needs to be aware of is the kind of data stored in the variable. It’s not the same to store a simple integer as it is to store a letter or a large floating-point number; even though they are all represented using zeros and ones, they are not interpreted in the same way, and in many cases, they don’t occupy the same amount of memory.<\/span><\/p>\n Recuperado de:\u00a0http:\/ \u00a0Para aquellos atascados que s\u00f3lo quieren saber lo que necesitan, hay 5 tipos de datos para las variables. Son string, int, float, long y bool.\u00a0<\/p>\n El tipo string es meramente para texto.<\/p>\n El tipo int es intiger que es para n\u00fameros enteros.<\/p>\n El tipo float es un n\u00famero que admite n\u00fameros con puntos decimales.<\/p>\n El tipo long es para n\u00fameros de gran valor.<\/p>\n El tipo bool es solamente para dar un valor de true o false.<\/p>\n Para funciones hay un valor llamado voit que es para que imprima un valor sin necesidad de poner un cout. Tener mucho cuidado con las funciones a utilizar sobre todo en las funciones.<\/p>\n
Fundamental data types are basic types implemented directly by the language that represent the basic storage units supported natively by most systems. They can mainly be classified into:<\/span><\/p>\n\n
'A'<\/code>\u00a0or\u00a0
'$'<\/code>. The most basic type is\u00a0
char<\/code>, which is a one-byte character. Other types are also provided for wider characters.<\/li>\n
7<\/code>\u00a0or\u00a0
1024<\/code>. They exist in a variety of sizes, and can either be\u00a0signed<\/em>\u00a0or\u00a0unsigned<\/em>, depending on whether they support negative values or not.<\/li>\n
3.14<\/code>\u00a0or\u00a0
0.01<\/code>, with different levels of precision, depending on which of the three floating-point types is used.<\/li>\n
bool<\/code>, can only represent one of two states,\u00a0
true<\/code>\u00a0or\u00a0
false<\/code>.<\/li>\n<\/ul>\n
Here is the complete list of fundamental types in C++:<\/span><\/p>\n\n\n
\n #f0f0f0;”>Group<\/th>\n #f0f0f0;”>Type names*<\/th>\n #f0f0f0;”>Notes on size \/ precision<\/th>\n<\/tr>\n \n Character types<\/td>\n char<\/strong><\/code><\/td>\n
Exactly one byte in size. At least 8 bits.<\/td>\n<\/tr>\n \n char16_t<\/strong><\/code><\/td>\n
Not smaller than\u00a0 char<\/code>. At least 16 bits.<\/td>\n<\/tr>\n
\n char32_t<\/strong><\/code><\/td>\n
Not smaller than\u00a0 char16_t<\/code>. At least 32 bits.<\/td>\n<\/tr>\n
\n wchar_t<\/strong><\/code><\/td>\n
Can represent the largest supported character set.<\/td>\n<\/tr>\n \n Integer types (signed)<\/td>\n signed char<\/strong><\/code><\/td>\n
Same size as\u00a0 char<\/code>. At least 8 bits.<\/td>\n<\/tr>\n
\n signed<\/em>\u00a0short<\/strong>\u00a0int<\/em><\/code><\/td>\n
Not smaller than\u00a0 char<\/code>. At least 16 bits.<\/td>\n<\/tr>\n
\n signed<\/em>\u00a0int<\/strong><\/code><\/td>\n
Not smaller than\u00a0 short<\/code>. At least 16 bits.<\/td>\n<\/tr>\n
\n signed<\/em>\u00a0long<\/strong>\u00a0int<\/em><\/code><\/td>\n
Not smaller than\u00a0 int<\/code>. At least 32 bits.<\/td>\n<\/tr>\n
\n signed<\/em>\u00a0long long<\/strong>\u00a0int<\/em><\/code><\/td>\n
Not smaller than\u00a0 long<\/code>. At least 64 bits.<\/td>\n<\/tr>\n
\n Integer types (unsigned)<\/td>\n unsigned char<\/strong><\/code><\/td>\n
(same size as their signed counterparts)<\/td>\n<\/tr>\n \n unsigned short<\/strong>\u00a0int<\/em><\/code><\/td>\n<\/tr>\n
\n unsigned<\/strong>\u00a0int<\/em><\/code><\/td>\n<\/tr>\n
\n unsigned long<\/strong>\u00a0int<\/em><\/code><\/td>\n<\/tr>\n
\n unsigned long long<\/strong>\u00a0int<\/em><\/code><\/td>\n<\/tr>\n
\n Floating-point types<\/td>\n float<\/strong><\/code><\/td>\n
\u00a0<\/td>\n<\/tr>\n \n double<\/strong><\/code><\/td>\n
Precision not less than\u00a0 float<\/code><\/td>\n<\/tr>\n
\n long double<\/strong><\/code><\/td>\n
Precision not less than\u00a0 double<\/code><\/td>\n<\/tr>\n
\n Boolean type<\/td>\n bool<\/strong><\/code><\/td>\n
\u00a0<\/td>\n<\/tr>\n \n Void type<\/td>\n void<\/strong><\/code><\/td>\n
no storage<\/td>\n<\/tr>\n \n Null pointer<\/td>\n decltype(nullptr)<\/strong><\/code><\/td>\n
\u00a0<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
* The names of certain integer types can be abbreviated without their\u00a0<\/span>signed<\/code>\u00a0and\u00a0<\/span>
int<\/code>\u00a0components – only the part not in italics is required to identify the type, the part in italics is optional. I.e.,\u00a0<\/span>
signed<\/em>\u00a0short\u00a0int<\/em><\/code>\u00a0can be abbreviated as<\/span>
signed short<\/code>,\u00a0<\/span>
short int<\/code>, or simply\u00a0<\/span>
short<\/code>; they all identify the same fundamental type.<\/span><\/p>\n