-
-
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
-
-
Plz explain following program
In the below program ,in function add() node * q is local but it acts as static ie I mean it works correctly how is it possible?#includeusing namespace std;class ll{public: struct node{ int data; node *link; }*p;ll(){p=NULL;}int add(int x){ node *q,*r;if(p==NULL){ r=new node; r->data=x; r->link=NULL;q=r; p=q;}else{r=new node;r->data=x;r->link=NULL;q->link=r;q=q->link;}return 0;}void display(){...
-
Diff betweeen static and local
In the below prog,node * q is local to a function add() but it acts as static .how?#includeusing namespace std;class ll{public: struct node{ int data; node *link; }*p;ll(){p=NULL;}int add(int x){ node *q,*r;if(p==NULL){ r=new node; r->data=x; r->link=NULL;q=r; p=q;}else{r=new node;r->data=x;r->link=NULL;q->link=r;q=q->link;}return 0;}void display(){ node *q; q=p;while(q!=NULL){cout
-
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