C++ Programming - Constructors and Destructors - Discussion
Discussion Forum : Constructors and Destructors - Programs (Q.No. 5)
5.
What will be the output of the following program?
#include<iostream.h>
int val = 0;
class IndiaBix
{
public:
IndiaBix()
{
cout<< ++val;
}
~IndiaBix()
{
cout<< val--;
}
};
int main()
{
IndiaBix objBix1, objBix2, objBix3;
{
IndiaBix objBix4;
}
return 0;
}
Discussion:
12 comments Page 2 of 2.
Chandu reddy said:
6 years ago
Why the objBixx4 is declared in scope and Any special is there?
Roshni said:
6 years ago
Why the object objBix4 is declared within the brackets?
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers