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
100+ Boats and Streams Problems with Solutions Pdf More
1000+ Aptitude Questions and Answers for Entrance Exam More
Partnership Questions and Answers More
Partnership Questions and Answers for Competitive Exams More
100+ Average Questions for Competitive Exams with Solutions More
Top 1000+ Quantitative Aptitude Questions with Answers More
TNPSC Chemistry MCQ Questions and Answers More
100+ Unscramble Words Quiz with Answers More
100+ Botany Objective Type Questions & Answers More
100+ General English Antonyms Questions & Answers 2020-21 More