July 2000
Intermediate to advanced
1280 pages
34h 55m
English
This is a new language facility (not available in C) whose goal is a further improvement in code readability and modifiability. When declaring a function, you can specify default values for one or more parameters in the parameter list.
Here is a declaration for a function sum() that computes the sum of given number of components of an array of double values. This declaration uses the initialization syntax for the second formal parameter to specify the default value 25.
double sum (const double a[], int n=25); // a prototype
This initialization syntax directs the compiler to use the default value specified in the prototype when no actual value is specified in the call in the client code.
double total; double ...
Read now
Unlock full access