Browse Source

Delete 'LvalueRefrence/Session1-2.cpp'

master
nasicurious 2 years ago
parent
commit
3d100446b4
  1. 46
      LvalueRefrence/Session1-2.cpp

46
LvalueRefrence/Session1-2.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()
{
cout << _a << "---" << endl;
}
void setA (int a)
{
_a =a;
}
};
void temp(Test t)
{
t.setA(10);
t.printValue();
}
int main()
{
Test t;
temp(t);
t.printValue();
return 0;
}
Loading…
Cancel
Save