home *** CD-ROM | disk | FTP | other *** search
- // ex02001.cpp
- // A program with default parameters in a function prototype
- #include <iostream.h>
-
- void show(int = 1, float = 2.3, long = 4);
-
- main()
- {
- show(); // all three parameters default
- show(5); // provide 1st parameter
- show(6, 7.8); // provide 1st two
- show(9, 10.11, 12L); // provide all three parameters
- }
-
- void show(int first, float second, long third)
- {
- cout << "\nfirst = " << first;
- cout << ", second = " << second;
- cout << ", third = " << third;
- }