jfcmacro

tiposdefusuario.cpp

Mar 16th, 2019
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. /*
  2. * fichero: tiposdefusuario.cpp
  3. *
  4. * proposito: mostrar la declaracion de variables globales
  5. *
  6. * compilar: $ g++ -o tiposdefusuario tiposdefusuario.cpp
  7. * $ make tiposdefusuario
  8. * ejecutar: $ ./tiposdefusuario
  9. */
  10. #include <iostream>
  11.  
  12. using namespace std;
  13.  
  14. /* <decls> ::= <decl>*
  15. <decl> ::= <tipo> <listvar> ";"
  16. <tipo> ::= <modent>? "int" | <modchar>? "char" | "float" | "long"? "double"
  17. <modent> ::= <signomod> | <modtam> | <signomod> <modtam>
  18. <signomod> ::= "signed" | "unsigned"
  19. <modtam> ::= "short" | "long" | "long long"
  20. <listvar> ::= ID <modarreglo> (,ID)*
  21. <modarreglo> ::= "[" <valorconst> "]"
  22. <valorconst> ::= INT | CONSTVALUE
  23. */
  24. int
  25. main(void) {
  26.  
  27. int a[10];
  28. char b[30];
  29. float c[45];
  30. double d[30];
  31.  
  32. cout << "tamano entero: "
  33. << sizeof(a)
  34. << endl;
  35.  
  36. return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment