I got this code:
I got dozens of errors like "You should use const test &". I think everything is correct with the code. why i got those errors?Code:#include <iostream> using namespace std; class test { private: int y; public: int z; test(test object) { y=object.z; } void print_y(); }; void test::print_y() { cout<<y<<endl; } int main() { test ob2; cout<<"Put whatever you want"; cin>>ob2.z; test ob1(ob2); ob1.print_y(); }
Thanks in advance.
Regards.




Reply With Quote
