This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class IntegerWrapper | |
{ | |
public: | |
// Operador de pre-incremento. | |
const IntegerWrapper &IntegerWrapper::operator++() | |
{ | |
mValor += 1; | |
return *this; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Se aplica RVO, porque el retorno de i++ NO SE USA | |
for (int i = 0; i < 4; i++) | |
{ | |
std::cout << i << '\n'; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int i = 0; | |
while (i < 4) | |
{ | |
std::cout << ++i << '\n'; | |
}; | |
std::cout << '\n'; | |
i = 0; | |
while (i < 4) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int siete = 666; | |
short unMillon = 666; | |
const char *const HolaMundo = “Adios Mundo!”; | |
bool falso = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
auto HolaMundo = “Hola Mundo!”; // Sin prefijo | |
auto HolaAncho = L“Hola Mundo!”; // Prefijo L | |
auto HolaUTF8 = u8”Hola Mundo!”; // Prefijo u8 | |
auto Hola_u = u”Hola Mundo!”; // Prefijo u | |
auto Hola_U = U”Hola Mundo!”; // Prefijo U | |
auto HolaRaw = R”(Hola Mundo)”; // Prefijo R”( y sufijo )” |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
auto HolaUTF8 = u8”Hola Mundo!”; // const char[12] | |
auto Hola_u = u”Hola Mundo!”; // const char16_t[12] | |
auto Hola_U = U”Hola Mundo!”; // const char32_t[12] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
auto comillas = u8R”(3 comillas dobles “””””);// const char[12] | |
auto barraEne = LR”(barra ene \n”); // const wchar_t[12] | |
auto barras4 = uR”(4 barras \\\\)”; // const char16_t[12] | |
auto barras6 = UR”(más barras \\\\\\)”; // const char32_t[12] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
auto flotante1 = 1.f; // float | |
auto flotante2 = .2f; // float | |
auto doble3 = 2.; // double | |
auto doble4 = .4; // double | |
auto entero5 = 5; // int | |
auto entero_sin_signo6 = 6u; // unsigned int | |
auto hola = ‘hola’; // int | |
auto zeta = ‘z’; // char |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
auto octal = 070; // int valor 56 en base 10 | |
auto hexadecimal = 0x70; // int valor 112 en base 10 | |
auto Fabada = 0xFabada; // int valor 16431834 en base 10 | |
auto OXIDAU = 0X1DAU; // unsigned int valor 474 en base 10 | |
auto unMillon = 1.e6f; // float 1 por 10 elevado a 6 | |
auto dosMillones = 2.E6; // double 2 por 10 elevado a 6 | |
auto tresMillones = 3E6f; // float 3 por 10 elevado a 6 | |
auto millonesima = 1E-6f; // float 1 por 10 elevado a -6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
auto dalmatas = 0b101; // int valor 5 en base 10 | |
auto noches = 0B1001; // int valor 9 en base 10 | |
auto Oblu = 0b1u; // unsigned int valor 1 en base 10 |
OlderNewer