home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / Ebooks / Thinking in C++ V2 / C03 / Basic.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2000-05-25  |  585 b   |  23 lines

  1. //: C03:Basic.cpp
  2. // From Thinking in C++, 2nd Edition
  3. // Available at http://www.BruceEckel.com
  4. // (c) Bruce Eckel 1999
  5. // Copyright notice in Copyright.txt
  6. // Defining the four basic data
  7. // types in C and C++
  8.  
  9. int main() {
  10.   // Definition without initialization:
  11.   char protein;
  12.   int carbohydrates;
  13.   float fiber;
  14.   double fat;
  15.   // Simultaneous definition & initialization:
  16.   char pizza = 'A', pop = 'Z';
  17.   int dongdings = 100, twinkles = 150, 
  18.     heehos = 200;
  19.   float chocolate = 3.14159;
  20.   // Exponential notation:
  21.   double fudge_ripple = 6e-4; 
  22. } ///:~
  23.