C++ Programming Interview Questions and Answers - 1
What is the difference between late binding and early binding?
Late binding refers to functions calls that are not resolved until run time while early binding refers to the events that occur at compile time.
Late binding occurs through virtual functions while early binding takes place when all the information needed to call a function is known at the time of compiling.
Early binding increases the efficiency. Some of the examples of early binding are normal function calls, overloaded function calls, and overloaded operators etc.
Define a constructor?
Constructor is a member functions of the class, with the name of the functions being the same as the class name. It also specifies how the object should be initialized.
Ways of calling constructor:
Implicitly: automatically by compiler when an object is created.
Calling the constructor explicitly is possible, but it makes the code unverifiable.
What is Standard Template Library (STL)?
A library of container templates approved by the ANSI committee for inclusion in the standard C++ specification.
A programmer who then launches into a discussion of the generic programming model, iterators, allocators, algorithms, and such, has a higher than average understanding of the new technology that STL brings to C++ programming.
What are virtual functions?
A virtual function allows derived classes to replace the implementation provided by the base class.
The compiler make sure the replacement is always called whenever the object in question is actually of the derived class, even if the objects is accessed by a base pointer rather than a derived class, even if users don’t know about the derived class.
What is friend function?
As the name suggests, the function acts as a friend to a class.
As a friend of a class, it can access its private and protected members.
A friend function is not a member of the class. But it must be listed in the class definition.
- C++ Interview Questions and Answers for Experienced
- Top 200+ C++ Interview Questions and Answers
- C++ Interview Questions and Answers for Freshers
- Advanced C++ Programming Interview Questions and Answers
- C++ Language Interview Questions for Experienced Pdf
- C++ Programs Asked in Interview for Freshers
- C++ Interview Questions and Answers Pdf
- C++ Language Interview Questions and Answers for Freshers Pdf
- C++ Questions and Answers
- Top 250+ C++ Constructor and Destructor Programming Interview Questions
- C++ basic interview questions and answers pdf
- C++ Programming Interview Questions and Answers
- C++ Technical Interview Questions and Answers
- Top 200+ Advanced C++ Interview Questions 2020-2021
- C++ Lab Viva-Practical Exams Questions and Answers
- C++ Coding Interview Questions and Answers
7000+ TNPSC Group 1, 2, 4, VAO Indian Economy Study Materials Pdf More
7000+ Gate Computer Science Engineering Previous Year Questions More
7000+ Fill in the Blanks with Suitable Homonyms More
7000+ Fill in the Blanks with Suitable Homophones More
Power Semiconductor Device and Integrated Circuits MCQ Questions Pdf More
Trb Exam Date 2020-2021| Annual Planner | Question Pattern | Eligibility More
1000+ Puzzles for Kids with Answers More
1000+ Steam Engine and Power Generation Objective Questions & Answers More
7000+ Prefix and Suffix MCQs with Answers Pdf More
Top 25+ WCF Interview Questions and Answers More