What are the conditions that have to be met for a condition to be an invariant of the class?
Answer / atul shankhwar
The condition should hold at the end of every constructor.
The condition should hold at the end of every mutator(non-const) operation.
Is This Answer Correct ? | 0 Yes | 0 No |
class X { public: int x; static void f(int z); }; void X::f(int y) {x=y;} What is the error in the sample code above? a) The class X does not have any protected members. b) The static member function f() accesses the non-static z. c) The static member function f() accesses the non-static x. d) The member function f() must return a value. e) The class X does not have any private members.
What are register variables?
Define stacks. Provide an example where they are useful.
What is the difference between a baller and a reference in C++?
What you mean by early binding and late binding? How it is related to dynamic binding?
Can malloc be used in c++?
State the difference between delete and delete[].
What is namespace & why it is used in c++?
whats the size of class EXP on 32 bit processor? class EXP { char c1; char c2; int i1; int i2; char *ptr; static int mem; };
What is c++ code?
What are namespaces in c++?
Can we specify variable field width in a scanf() format string? If possible how?