-
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
-
-
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
-
-
Using Templates
What is the disadvantage of using too many templates?
-
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 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
-
Reverse A Linked List
What is the most efficient way to reverse a linklist?
-
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);
-
Smart Pointers
What is Smart Pointer in C++?
-
-
Memory Allocation
Why is it suggested not to use malloc() or calloc() in C++ for memory allocation?
-
Program Crash
When can it happen that before calling main function itself program gets crashed?
-
Binary Search Algorithm
Why Binary Search Algorithm is a device and conquer based algorithm?
-
What is an object?
Object is a software bundle of variables and related methods. Objects have state and behavior.
-
-
-
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.
-
Find Type of Triangle
Write a C++ program to find the type of a triangle by reading three sides of a triangle.
C++ Interview Questions
Ans