C interview questions – page 17

2,130 questions. Tap “Show answer” to check yourself.

Advertisement
  1. What is the difference between functions defined inside the class and outside the class? which one should be preferred?

  2. Difference between multilevel and multiple inheritance?

  3. What is std::auto_ptr?

  4. What will be output of the following code#includeusing namespace std;class abc{public :void main(){cout<<" Its main function "< }};int main(int c, char **v){abc a;if(c<1){cout<<" Error can not accept it "< exit(1);}cout<<" its in main program "< a.main();

  5. You have a library provided by the vendor. All you have is header files and library files. Library contains the class Shape and there is whole hierarchy tree (i mean classes which derive from this base class). Now you want to add some ...

  6. How do you initialize a static member of a class with return value of some function?

  7. What is object based language and what is object oriented language?

  8. Whats the difference between an interface and a abstract class?

  9. What is an adjust field format flag?

  10. What difference in behavior you find between Virtual destructors and other virtual functions and why?

  11. Explain how an exception handler is defined and invoked in a Program

  12. How does a compiler keep track of functions to call for an object?

  13. Advertisement
  14. When would a programmer prefer using vprintf() over printf()? In what scenarios during programming would you use vprintf() rather than a printf()?

  15. MULTICHOICE VIDEO RENTAL SHOP needs an Object Oriented program that process the following information about ten (10) videos in their stock?The title, the director, the year produced and a list of main actors for each video. (If there are more than five ma

  16. Discuss inheritance in C++ using a linked list example?

  17. What happens when an exception is throws from an object&#39;s constructor?

  18. Base class contains 2 functions and Derived class (with Private Inheritance from Base) also contains 2 functions (same name as those in Base cass), then he asked me the effect by changing the Inheritance type and making different functions virtual..

  19. Is the following code an Example of Dynamic Binding Explain?

  20. Out of multiple if-else statements and a switch statement, which is faster and why?

  21. Why we make objects const when passing to a copy constructor and why we pass by reference?

  22. What relationship is resolved by an intersecting or associative entity ? a) Recursive b) Mandatory one to one c) Many to Many d) One to One

  23. Explain how the virtual base class is different from the conventional base classes of the opps.

  24. What r abstract classes?

  25. What is an iterator?

  26. Advertisement
  27. When is user defined copy constructor needed?

  28. How can we give default values to class variables without calling constructor?

  29. Write C++ program to accept 20 nos and then display max & min.

  30. Write a C++ program that contains a structure named ?Student? having two data members1) Name2) CGPADeclare array of structure ?Student? of size 10 .Populate this array by taking data from file inputFile.txt.File inputFile.txt contains Name and C

  31. Give some imaginative solutions to dining philosophers problem

  32. What are smart pointer? how would u implement them?

Advertisement