1.midterm copy constructor belası O_o
#include<iostream
#include<string>
using namespace std;
class car
{
public:
car():name("mercedes"),model(2013){}
car(string x,int y)
{
name=x;
model=y;
}
car(car & p) //copy constructor
{
name=p.name;
model=p.model;
}
void print()
{
cout<<name<<endl;
cout<<model<<endl;
}
private:
string name;
int model;
};
int main()
{
car a("ferrari",2010);
car b(a);
car c;
car d;
a.print();
b.print();
c.print();
d.print();
return 0;
}