Coupon Accepted Successfully!



  1. A class in C++ is similar to structure in C. Using class or structure, a programmer can merge one or more dissimilar data types and a new custom data type can be created.
  2. In C++, classes and structures contain member variables and member functions in their declarations with private and public access blocks that restrict the unauthorized use. The defined classes and structures further can be used as custom data type in the program to declare objects.
  3. The private and public are new keywords in C++. The private keyword is used to protect specified data and functions from illegal use whereas the public keyword allows access permission.
  4. The member function can be defined as private or public inside the class or outside the class.
  5. To access private data members of a class, member functions are used.
  6. The difference between member function and normal function is that the normal function can be invoked freely, whereas the member function can be invoked only using the object of the same class.
  7. The static is a keyword used to preserve the value of a variable. When a variable is declared as static, it is initialized to zero. A static function or data element is only recognized inside the scope of the present compile.
  8. When a function is defined as static, it can access only static member variables and functions of the same class. The static member functions are called using its class name without using its objects.
  9. The member functions of a class can also be declared as constant using const keyword. The constant functions cannot modify any data in the class.
  10. An object of a class can be passed to the function as arguments like variables of other data type. When an object is passed-by-value, then this method is called as pass-by-value, whereas when reference of an object is passed to the function then this method is called as pass-by-reference.
  11. When classes are declared inside a function, then such classes are called as local classes. The local classes have access permission to global variables as well as static variables. The local classes should not have static data member and functions.

Test Your Skills Now!
Take a Quiz now
Reviewer Name