【正文】
data members cannot be assigned values。t have a return type, so it39。. For a constructor, the method name is left out. That is Foo::Foo(int, long) const is mangled as `__C3Fooil39。myDate, 3 )。 Must have same method name. using39。t able to instantiate an object using this base class. You can make a pure virtual function or abstract class this way.. class Boo { void foo() = 0。m child endl。 parent_object_ptrshow() // calls parentshow() i now we goto virtual world... class parent { virtual void Show() { cout i39。 class child: public parent { void Show() { cout i39。 double value = cuberoot ( temp)。 } double temp = 。t be any copy of the arguments x and y instead they refer to original variables a and b. so no extra memory needed to pass arguments and it is more efficient. When do use const reference arguments in function? a) Using const protects you against programming errors that inadvertently alter data. b) Using const allows function to process both const and nonconst actual arguments, while a function without const in the prototype can only accept non constant arguments. c) Using a const reference allows the function to generate and use a temporary variable appropriately. When are temporary variables created by C++ piler? Provided that function parameter is a const reference, piler generates temporary variable in following 2 ways. a) The actual argument is the correct type, but it isn39。 y = temp。 What is passing by reference? Method of passing arguments to a function which takes parameter of type reference. for example: void swap( int amp。 // plier is happy allowed What is reference ?? reference is a name that acts as an alias, or alternative name, for a previously defined variable or an object. prepending variable with amp。 mutable double salary。s termination routine (. its destructor) and then releases the space the object occupied on the heap memory. If an array of objects was created using new, then delete must be told that it is dealing with an array by preceding the name with an empty []: Int_t *my_ints = new Int_t[10]。t invoke object39。 } }。 }。 // calling Boo constructor Boo Obj2(Obj1)。s origin. What is inheritance? Inheritance allows one class to reuse the state and behavior of another class. The derived class inherits the properties and method implementations of the base class and extends it by overriding methods and adding additional properties and methods. What is Polymorphism?? Polymorphism allows a client to treat different objects in the same way even if they were created from different classes and exhibit different behaviors. You can use implementation inheritance to achieve polymorphism in languages such as C++ and Java. Base class object39。s operation from the rest of the application. For example, a client ponent asking for revenue from a business object need not know the data39。t implement one in your class then piler implements one for you. for example: Boo Obj1(10)。t define one.?? default ctor copy ctor assignment operator default destructor address operator What is conversion constructor? constructor with a single argument makes that constructor as conversion ctor and it can be used for type conversion. for example: class Boo { public: Boo( int i )。 public: Boo(int i ) operator double() { return value。 // assigning object to variable i of type double. now conversion operator gets called to assign the value. What is diff between malloc()/free() and new/delete? malloc allocates memory for object in heap but doesn39。 Are not extensible new and delete can be overloaded in a class delete first calls the object39。 } What are C++ storage classes? auto register static extern auto: the default. Variables are automatically created and initialized when they are defined and are destroyed at the end of the block containing their definition. They are not visible outside that block register: a type of auto variable. a suggestion to the piler to use a CPU register for performance static: a variable that is known only in the function that contains its definition but is never destroyed and retains its value between calls to that function. It exists from the time the program begins execution extern: a static variable whose definition and placement is determined when all object and library modules are bined (linked) to form the executable code file. It can be visible outside the file where it is defined. What are storage qualifiers in C++ ? They are.. const volatile mutable Constkeyword indicates that memor