Friday, October 17, 2008

Parking Lot

  • A comment that begins with /* always ends with the next */. As a result, one comment pair cannot occur within another.
  • Headers for the standard library are enclosed in angle brackets (< >). Nonstandard headers are enclosed in double quotes (" "). eg: #include<> #include"SaleItem.h".

  • We can declare a name without defining it by using the extern keyword. A declaration that is not also a definition consists of the object's name and its type preceded by the keyword extern:

          extern int i;   // declares but does not define i
    int i; // declares and defines i
  • extern double pi = 3.1416; // definition
  • constvariables are local to a file by default. To make a const variable accessible to other files we must explicitly specify that it is extern.
  • By default, the access level in C++ in classes is Private.
  • Header files are for Declarations, Not Definitions.
  • It might be logical to expect that size returns an int or an unsigned. Instead, the size operation returns a value of type string::size_type.

No comments: