-
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.
-
-
-
What is an object?
Object is a software bundle of variables and related methods. Objects have state and behavior.
-
Binary Search Algorithm
Why Binary Search Algorithm is a device and conquer based algorithm?
-
Program Crash
When can it happen that before calling main function itself program gets crashed?
-
Memory Allocation
Why is it suggested not to use malloc() or calloc() in C++ for memory allocation?
-
-
Smart Pointers
What is Smart Pointer in C++?
-
Placement New Syntax
How can a C++ developer use the placement new syntax to make new allocate an object of class SomeClass at a particular memory address stored in a pointer type variable named pmem?A. new SomeClass(pmem);B. new(pmem) SomeClass;C. new SomeClass pmem;D. new pmem SomeClass;E. new (pmem, SomeClass);
-
Reverse A Linked List
What is the most efficient way to reverse a linklist?
-
Using Inheritance
Using inheritance, which of the following is not alloweda) Changing implementation of operation in parent by the subclassb) Using implementation of operation in parent class by the subclassc) Using attributes in parent class by the subclassd) Having operations is subclass which do not exist in parent classe) None
-
Exception handling vs. return values to signal an error
Why we would use exception handling rather than different return values to signal an error?
-
Dynamic Binding
Why is Dynamic binding (regarding DLLs) are considered better in comparison with static binding? What are DLLs and how they work?
-
Using Templates
What is the disadvantage of using too many templates?
-
-
Two Dimension Array
A two dimension array can also be thought of asChoose one answer. a. Table. b. Array of arrays.c. A file.d. None of the above e. A and B
-
-
Classes
Who can access private data in a class?Choose one answer. a. members of the class b. friends of the class c. everyone d. A and B
-
Operators
Which of the following operators cannot be overloaded?Choose one answer. a. [ ] b. == c. . d. =
C++ Interview Questions
Ans