Define the process of handling in case of destructor failure?
No Answer is Posted For this Question
Be the First to Post Answer
How is modularity introduced in C++?
What is a NULL Macro? What is the difference between a NULL Pointer and a NULL Macro?
What number of digits that can be accuratly stored in a float (based on the IEEE Standard 754)? a) 6 b) 38 c) An unlimited number
What are the various storage classes in C++?
How much maximum can you allocate in a single call to malloc()?
What is low level language in simple words?
What is the use of static functions?
What are the rules for naming an identifier?
class HasStatic { static int I; }; Referring to the sample code above, what is the appropriate method of defining the member variable "I", and assigning it the value 10, outside of the class declaration? a) HasStatic I = 10; b) int static I = 10; c) static I(10); d) static I = 10; e) int HasStatic::I = 10;
True or false, if you keep incrementing a variable, it will become negative a) True b) False c) It depends
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; }
Can we use this pointer inside static member function?