home *** CD-ROM | disk | FTP | other *** search
- //: C03:Basic.cpp
- // From Thinking in C++, 2nd Edition
- // Available at http://www.BruceEckel.com
- // (c) Bruce Eckel 1999
- // Copyright notice in Copyright.txt
- // Defining the four basic data
- // types in C and C++
-
- int main() {
- // Definition without initialization:
- char protein;
- int carbohydrates;
- float fiber;
- double fat;
- // Simultaneous definition & initialization:
- char pizza = 'A', pop = 'Z';
- int dongdings = 100, twinkles = 150,
- heehos = 200;
- float chocolate = 3.14159;
- // Exponential notation:
- double fudge_ripple = 6e-4;
- } ///:~
-