Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * fichero: tiposeledec.cpp
- *
- * proposito: mostrar la declaracion de variables globales
- *
- * compilar: $ g++ -o tiposeledec tiposeledec.cpp
- * $ make tiposeledec
- * ejecutar: $ ./tiposeledec
- */
- #include <iostream>
- using namespace std;
- /* <decls> ::= <decl>*
- <decl> ::= <tipo> <listvar> ";"
- <tipo> ::= <modent>? "int" | <modchar>? "char" | "float" | "long"? "double"
- <modent> ::= <signomod> | <modtam> | <signomod> <modtam>
- <signomod> ::= "signed" | "unsigned"
- <modtam> ::= "short" | "long" | "long long"
- <listvar> ::= ID (,ID)*
- */
- int
- main(void) {
- int a;
- char b;
- float c;
- double d;
- cout << "tamano entero: "
- << sizeof(a)
- << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment