What is the use of class in c++?
No Answer is Posted For this Question
Be the First to Post Answer
What do you mean by translation unit?
What is null pointer and void pointer?
char *ch = "abcde"; char c[4]; how to copy 'ch' to 'c'?
How would you use the functions randomize() and random()?
When the design recommends static functions?
What do you mean by stack unwinding in c++?
WHO DEVELOPED C++?
what is object?
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; }
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;
Why are arrays usually processed with for loop?
What is an adaptor class or Wrapper class?