////////////////////////////////////////
#include
// Prototype
void show(int = 1, float = 2.3, long = 4);
////////////////////////////////////////
// The main() function.
////////////////////////////////////////
main()
{
    show();              // all three arguments default
    show(5);             // provide 1st argument
    show(6, 7.8);        // provide 1st two
    show(9, 10.11, 12L); // provide all three arguments
}
////////////////////////////////////////
// Display results of default arguments.
////////////////////////////////////////
void show(int first, float second, long third)
{
    std::cout << "  first = "  << first;
    std::cout << ", second = " << second;
    std::cout << ", third = "  << third << std::endl;
}

Like it on Facebook, Tweet it or share this article on other bookmarking websites.

No comments