August 2012
Intermediate to advanced
976 pages
30h 17m
English
A simple variable definition consists of a type specifier, followed by a list of one or more variable names separated by commas, and ends with a semicolon. Each name in the list has the type defined by the type specifier. A definition may (optionally) provide an initial value for one or more of the names it defines:
int sum = 0, value, // sum, value, and units_sold have type int units_sold = 0; // sum and units_sold have initial value 0Sales_item item; // item has type Sales_item (see § 1.5.1 (p. 20))// string is a library type, representing a variable-length sequence of charactersstd::string book("0-201-78345-X"); ...
Read now
Unlock full access