Browse Source

Delete 'LvalueRefrence/Session1-4.cpp'

master
nasicurious 2 years ago
parent
commit
e23a7099da
  1. 46
      LvalueRefrence/Session1-4.cpp

46
LvalueRefrence/Session1-4.cpp

@ -1,46 +0,0 @@
#include <iostream>
using namespace std;
class Test
{
private:
int _a;
int& _b=_a;
public:
Test()
{
_a = 5;
cout << "Normal constructor"<< endl;
}
Test(const Test& rhs)
{
_a = rhs._a;
cout << "copy constructor"<< endl;
}
void printValue() const
{
cout << _a << "---" << endl;
}
void setA (int a)
{
_a =a;
}
};
void temp(const Test& t)
{
t.printValue();
}
int main()
{
Test t;
temp(t);
t.printValue();
return 0;
}
Loading…
Cancel
Save