Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * fichero: tiposelem.cpp
- *
- * proposito: mostrar la declaracion de variables globales
- *
- * compilar: $ g++ -o tiposelem tiposelem.cpp
- * $ make tiposelem
- * ejecutar: $ ./tiposelem5
- */
- #include <iostream>
- #include <limits>
- using namespace std;
- int
- main(void) {
- cout << "valor minimo booleano: "
- << numeric_limits<bool>::min()
- << " valor maximo booleano: "
- << numeric_limits<bool>::max()
- << " numero bytes: "
- << sizeof(bool)
- << endl;
- cout << "valor minimo caracter: "
- << numeric_limits<char>::min()
- << " valor maximo booleano: "
- << numeric_limits<char>::max()
- << " numero bytes: "
- << sizeof(char)
- << endl;
- cout << "valor minimo entero: "
- << numeric_limits<int>::min()
- << " valor maximo entero: "
- << numeric_limits<int>::max()
- << " numero bytes: "
- << sizeof(int)
- << endl;
- cout << "valor minimo flotante: "
- << numeric_limits<float>::min()
- << " valor maximo booleano: "
- << numeric_limits<float>::max()
- << " numero bytes: "
- << sizeof(float)
- << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment