Professional Documents
Culture Documents
Instantiate Objects
http://www.careerlink.vn/timviec-lam/programmingtraining-officer/369466
A class template
An object has both a state and behavior. The state defines the object, and the behavior defines what the object does.
Declaration: Class
Tells the compiler what member functions and data members belong to the class. Keyword class followed by the classs name. Class body is enclosed in braces ({}) Specifies data members and member functions Access-specifier public:
Indicates that a member function or data member is accessible to other functions and member functions of other classes.
Main Function
Use dot operator to call Times member function
Example
Write a program that asks the user to input a name in the format last, first and outputs the name as first name, last name Sample run:
Input a name in the format Last, First: Minh, Phuong Output: Phuong Minh