class MyInteger
{
friend ostream& operator<<(ostream& out, const MyInteger& p);
private:
int sex;
public:
int num;
MyInteger(int num) :num(num) {
sex = 100;
};
};
ostream& operator<<(ostream& out, const MyInteger& p) {
return cout << "num:" << p.num << '\t' << "sex:" << p.sex;
}
int main() {
MyInteger p = 10;
cout << p << endl;
system("pause");
return 0;
}