Here is the code:
#include<iostream>
using namespace std;
class Rectangle
{
private :
int _width;
int _height;
public :
Rectangle()
: _width{},_height{}
{}
Rectangle(int initial_w, int initial_h)
: _width{initial_w}, _height{initial_h}
{}
int get_width(){return _width;}
};
int main()
{
Rectangle a;
Rectangle(2,3);
cout<<a.get_width()<<endl;
}
I don't understand why it returns 0, i thought it is supposed to be 2. Please help!!!!!