The code mentioned would give errors while compiling. But when i have done some minor modifications to successfully compile the code, I was surprised to c that this code works fine.Later i had to come...
jayq
Sep 17th, 2006
The program you supplied has many type'o's so it will output only compile time errors.However if you fix the syntax, there'll be no controversy in this source : it ALWAYS outputs : its in main program...
In general, volatile keyword signals compiler that the declared variable should not be optimized by any ways (e.g. it should not be cached, kept in registers etc but anytime it's used - it should be r...
minli
Apr 9th, 2006
(P876 from textbook C++ How To Program:)The volatile type qualifier is applied to a definition of a variable that may be altered from outside the program (i.e., the variable is not completely under th...
To avoid memmory leaks you should use smart pointers.
Guest
Jul 17th, 2006
When dynamic memory allocation is used extensively, memory leak may occur.It happens when first memory block is not deleted . However, the address is lost because the pointer contains the address of s...
Constructor is initialized the data members....in the above case no data members r there in the class.....so....i think compiler call default constructor but it does nothing...
When a c++ program is compiled and executed the constructor is invoked first. if a constructor is not declared or defined by the user then the compiler invokes the default constructor.
Run-time type information (RTTI) is a mechanism that allows the type of an object to be determined during program execution. RTTI was added to the C++ language because many vendors of class libraries ...
A
Jan 28th, 2006
In case of Virtual function we are responsible for deciding the function at run time. Its our logic that reflects and no one does any thing.Where as in case of RTTI TYPE is found of object. We dont do any thing for that. We simply use that.
In case of Array , the ArrayName is Nothing but a Base Address, when we use [] operator , it treats leftmostvalue as a base address and rightside value as an offset so it adds BaseAddress+Offset and g...
paulson paul chambakottukudyil
Apr 12th, 2006
Array name is a constant pointer pointing to the base address(address of the first byte where the array begin) of the memory allocated. When you use arr[i], the compiler manipulates it as *(arr + i). ...
Pass By Value example:The function receives a copy of the variable. This local copy has scope, that is, exists only within the function. Any changes to the variable made in the function are not passed...
rahultripathi
Sep 24th, 2005
There is major defference between these three are when we want to avoid making the copy of variable and we want to change value of actual argument on calling function. there are we use passing by pointer,passing the reference. We can not perform arithmentic operation on reference.
you can instantiat a template in two ways. 1. Implicit instantiation and 2. Explicit Instantion. implicit instatanitioan can be done by the following ways:template <class T>class A{public: A(){}...
Ans