Latest Answer: If we are working with multiple inheritance, it is always better to make the base class as virtual inorder to avoid the multiple copies of the base class data. :) ...
Latest Answer: Escaping variable uses when you want to break loop.int flag = 1; //flag is an escaping variablefor(...){ for(...) { flag = 1; ... if(..) { flag = 0; break; } } if(flag==0) break;} ...
Class X{X(){}X(X &obj){} // supose '=' operator is also overloaded for this class. I am not writing code for that }main(){X a;X b = a;X c(&a);X d;d = a;}What is the difference between a, b, c, d objects ?
Latest Answer: node*GetNthFromEnd(node* pHead, int n) { if ( ! pHead ) return NULL; int i = 0; node* p = pHead; node* pnth = pHead; while (p) { ...
Suppose there is a txt file with following format:Student name Grades in subjectsX ABA+CDA+Y B+CAA+AAthere can be many students with there grades in various subjects. (number of subjects are unknown)Possible values of grade are: A, A+, B, B+, C, D now suppose the file gets corrupted and all '+' are replaced by 'A'Write a program to restore the file
Write a program to dynamically create a matrix( no of rows and columns wud be provided by user at run time). Then ask a user to input elements and the nprint those elements.
Under which conditions compiler provide default constructor to an object when no default constructor is defined in the class definition?
Latest Answer: Less than or equal to those mentioned in the prototype.Less when default arguments are also provided in prototype. ...
Latest Answer: There was little error in the code in my previous answer. We have to define a public static member function for this purpose. Here is the codeclass sample{sample* p;sample();public:static sample genObject();};sample* sample::genObject(){p=new ...
Design a class for car inventory . For every new car from the manufacturer there should be minimal changes to the code.
View page << Previous 6 7 8 9 [10] 11 12 13 14 15 Next >>

Go Top