11.07.2015 Views

tYSR20

tYSR20

tYSR20

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

224Part III: Introduction to ClassesOverloading a function means to define two functions with the same shortname but with different types of arguments. See Chapter 6 for the latest newson function overloading.C++ chooses the proper constructor based on the arguments in the declarationof the object. For example, the class Student can have all three constructorsshown in the following snippet at the same time://// OverloadConstructor - provide the class multiple// ways to create objects by// overloading the constructor//#include #include #include #include using namespace std;const int MAXNAMESIZE = 40;class Student{public:Student(){cout

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!