Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * fichero: tiposdefusuario.cpp
- *
- * proposito: mostrar la declaracion de variables globales
- *
- * compilar: $ g++ -o tiposdefusuario tiposdefusuario.cpp
- * $ make tiposdefusuario
- * ejecutar: $ ./tiposdefusuario
- */
- #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 <modarreglo> (,ID)*
- <modarreglo> ::= "[" <valorconst> "]"
- <valorconst> ::= INT | CONSTVALUE
- */
- int
- main(void) {
- int a[10];
- char b[30];
- float c[45];
- double d[30];
- cout << "tamano entero: "
- << sizeof(a)
- << endl;
- return 0;
- }
Add Comment
Please, Sign In to add comment