What do you know about friend class and friend function?
A friend function is a function that is specified outside a class but has the ability to access the class members' protected and private data. A friend can be a member's function, function template, or function, or a class or class template, in which case the entire class and all of its members are friends.
| Is This Answer Correct ? | 0 Yes | 0 No |
How do you traverse a btree in backward in-order?
What is near, far and huge pointers? How many bytes are occupied by them?
What are the various situations where a copy constructor is invoked?
What is an ABC: an "Abstract Base Class"?
How should a contructor handle a failure?
They will ask u question about single linked list?. Write Code for to insert delete node.
What data encapsulation is in c++?
What is algorithm in c++ programming?
Which is best c++ or java?
Find out the bug in this code,because of that this code will not compile....... #include <iostream> #include <new> #include <cstring> using namespace std; class balance { double cur_bal; char name[80]; public: balance(double n, char *s) { cur_bal = n; strcpy(name, s); } ~balance() { cout << "Destructing "; cout << name << "\n"; } void set(double n, char *s) { cur_bal = n; strcpy(name, s); } void get_bal(double &n, char *s) { n = cur_bal; strcpy(s, name); } }; int main() { balance *p; char s[80]; double n; int i; try { p = new balance [3]; // allocate entire array } catch (bad_alloc xa) { cout << "Allocation Failure\n"; return 1; }
What is virtual function? Explain with an example
Explain the differences between list x; & list x();.