Top 25 Latest C++ Interview Questions
- What’s the deal with constructors?
- Which constructor gets called when I create an array of Fred objects?
- Should my constructors use “initialization lists” or “assignments”?
- Is there any difference between List x; and List x();?
- Can one constructor of a class call another constructor of the same class to initialize this object?
- Is the default constructor of the same class to initialize this object?
- Should my class declare a member function or a friend function?
- What does it mean that “friendship is not inherited, transitive or reciprocal”?
- What are some advantages/disadvantages of using friend functions?
- Do friend functions violates encapsulation?
Also read: Most important questions in c for bca and bscit
- Construct a program to demonstrate how a class first has granted its friendship to the class second to access the private data of the class first through the public member function of the class second.
- Various Operations that can be performed casins file handling/ stream class.
- What do you mean by the OOPS function?
- Explain the concept of Exceptions Handling. Discuss try, catch, and throw using a suitable program.
- What are virtual function modes in which a file can be accessed with the help of a simple program?
- Explain the various mode in which a file can be accessed with the help of a simple program.
- How do the properties of the following two derived classes differ?
- class X: public A{//..}
- class Y: private A{//..}
- What is Generic Programming? Explain with example.
- Write a program to show the overloading of function templates.
- What do you mean by operator overloading? Explain the concept of operator overloading using the program of the binary operator.
- Discuss Inline function with syntax.
- Write a program to show the functioning of static members’ functions.
- What is the need of a friend function? Also, discuss the concept of a friend? Also, discuss the concept of friend class with syntax.
- Define a class to represent a bank account.
- Its contain Data Members:
- Name of the depositor
- Account Number
- Type of the account balance
- Members Function
- To assign initial values
- To deposit an amount
- To withdraw an account, the amount available
- Display the name and balance.
- Write a program that demonstrates hierarchical inheritance to get square and cube of a number in c++ programming language.
C++ Interview Questions for Freshers & College Students for free. Mostly appeared questions in exam and interview.