Destructor is a special member function of a class, which is called automatically by the compiler when the object is getting destroyed. In general we write the code here to cleanup the resources that ...
kavitha
Jul 26th, 2006
desturctor is to destory objects.this is denoted by '~'.for eg:class alpha{public:read(int);disp();~alpha();};void alpha::read(){cout<<"Enter i":cin>>i;}void alpha::~alpha(int i){i--;cout<<i;}
Each and every float constant in C/C++ treated as double, because of this this program won't work as you expected. Add "f" like ".7f" after every float constant then it works as you expected.
Akash
Feb 6th, 2007
The output of the above programme will be b=0.5 .7 is not stored as 0.7 ie it is stired to some value which is slightly less that 0.7 so the control will not work as expected [this is the only excception i guess for floating point nos]
The answer is 2, because the statementi = (++i) / (i++)will be processed from left to righti = (++10) / (10++)which meansi = 11/10++Here still ++ operator is not executedi = 1++; // 1 because it is an integer operationi = 2;if you changei = (++i) / (++i) you will see 1
Actually arr and &arr are different.
arr holds the base address of the array arr[], but &arr holds the address of the entire array.
but both expressions points to the same base address.{geshibot langu...
String is nothing but charatcer array, There are some special featues(functions like strupr, strlen etc) available for strings as compared with Arrays.
raj
Apr 26th, 2006
Strings always ends with a NULL (\0) character but not array
printf is the standart function in (c) programming language library for printing formatted output.egprintf writes the resulting string to the standard output(remember, Awk has...
new and freeWhen you use new operator for allocating the memory, it calls constructor by default, and when free the memory using "free" function, it won't call destructor of the class.so...
1. new and free - no constructor was called so you can get blocked memory(memory leak), but no error2. calloc and delete - delete can be called to the object of the class, so you'll get and error