jfcmacro

tiposelemdec.cpp

Mar 16th, 2019
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  1. /*
  2.  * fichero: tiposeledec.cpp
  3.  *
  4.  * proposito: mostrar la declaracion de variables globales
  5.  *
  6.  * compilar: $ g++ -o tiposeledec tiposeledec.cpp
  7.  *           $ make tiposeledec
  8.  * ejecutar: $ ./tiposeledec
  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 (,ID)*
  21. */
  22. int
  23. main(void) {
  24.  
  25.   int a;
  26.   char b;
  27.   float c;
  28.   double d;
  29.  
  30.   cout << "tamano entero: "
  31.        << sizeof(a)
  32.        << endl;
  33.  
  34.   return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment