Computer Science[C++]

A class can contain one of the three types of functions, which are accessor functions, mutator functions and manager functions. Accessor function is a member function that accesses contents of object but does not modify that object. It simply returns value of one of the member variables. Mutator function, also known as “set” methods, is used to modify the value of an object.

Manager functions are special member functions which have specific features to perform the task. Constructor is a special type of function, which is required to create an object. A constructor is a special member function of the class. It has the same name as the class and is called automatically when an object of the class is created. Its primary job is to give legal initial values to an object. A constructor can be called implicitly and explicitly. A constructor that does not accept any arguments is a default constructor. A constructor that takes arguments is a parameterized constructor. Constructor is a special type of function, which is required to create an object. Every time an object is created, the compiler will automatically initialize it by invoking the initialization function. The copy constructor is used when an object is initialized using another object. Destructor is a function with the same name as that of class name preceded by a tiled sign (~). It is used to release the memory allocated by the constructor.

To Access the full content, Please Purchase