#include<vector> #include<iostream> class mytype { private: int cor[2]; public: mytype(); mytype(int x , int y); ~mytype(){} mytype (const mytype & m); mytype & operator = (const mytype & m); friend std::ostream & operator << (std::ostream os , const mytype & m); }; mytype::mytype() { cor[0]=0; cor[1]=0; } mytype::mytype(int x , int y) { cor[0]=x; cor[1]=y; } mytype::mytype(const mytype & m) { cor[0]=m.cor[0]; cor[1]=m.cor[1]; } mytype & mytype::operator = (const mytype & m) { cor[0]=m.cor[0]; cor[1]=m.cor[1]; return * this; } std::ostream & operator << (std::ostream & os , const mytype & m) { os << m.cor[0] << "," << m.cor[1]; return os; }
friend std::ostream & operator << (std::ostream os , const mytype & m);
std::ostream & operator << (std::ostream & os , const mytype & m)
ostream& operator<<(ostream& os, const myType& dt);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)