
February 4th, 2013, 08:46 AM
|
|
Registered User
|
|
Join Date: Feb 2013
Posts: 1
Time spent in forums: 20 m 51 sec
Reputation Power: 0
|
|
|
Problem
#include<iostream>
using namespace std;
class test
{
int a;
int b;
public:
test();
test(test& other);
test& operator=(const test& other);
};
test p(test other);
int main()
{
test one;
test two(one);
one=dokimi(two);//I have a problem here
return 0;
}
test::test():a(0),b(0){}
test::test(test& other)
{
a=other.a;
b=other.b;
}
test& test:  perator=(const test& other)
{
a=other.a;
b=other.b;
return *this;
}
test p(test other)
{
return other;
}
I have a problem with function p, but I can not figure out why
|