//.h


#ifndef __POINT_H_

#define __POINT_H_


#include <iostream>


class Point{

private:

int xpos, ypos;

public:

Point(int x=0, int y=0);

friend ostream& operator<<(ostream& os, const Point& pos);

};


#endif


//.cpp


#include <iostream>

#include "Point.h"

using namespace std;

Point::Point(int x, int y) :xpos(x), ypos(y){}


ostream& operator<<(ostream& os, const Point& pos){

os<<'['<<pos.xpos<<", "<<pos.ypos<<']'<<endl;

return os;

}



xpos에 접근에 안됨