C++ Viva
C++ Viva
Answer: C++ is a general-purpose programming language that was developed as an extension of the C
programming language. It supports both procedural and object-oriented programming paradigms.
What is inheritance?
Answer: Inheritance is a mechanism in which one class inherits the proper es and behaviors of another
class. It allows for code reuse and establishes a hierarchical rela onship between classes.
What is polymorphism?
Answer: Polymorphism is the ability of an object to take on many forms. In C++, it can be achieved through
func on overloading and func on overriding.
a feature
What is the difference between the ++i and i++ increment operators?
Answer: The ++i is the prefix increment operator that increments the value of i and then returns the
incremented value. The i++ is the pos ix increment operator that returns the current value of i and then
increments it.