#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
class Point
{
private:
float x, y;
public:
float getx() { return x; }
void setx(float a) { x = a; }
float gety() { return y; }
void sety(float b) { y = b; }
};
int main(void)
{
Point p1, p2 ,p3;
float v, w;
cout << "Write first point : ";
cin >> v;
p1.setx(v);
cin >> w;
p1.sety(w);
endl;//여기랑
cout << "Write second point : ";
cin >> v;
p2.setx(v);
cin >> w;
p2.sety(w);
endl;//여기서 자꾸 "식별자" 함수 오버로드를 확인할 수 없다고 뜸
v = p1.getx() + p2.getx();
w = p1.gety() + p2.gety();
p3.setx(v);
p3.sety(w);
cout << "<< sum of two points >>" << endl;
cout << " x y"<< endl;
cout << "p1 " << setprecision(4) << p1.getx() << " " << p1.gety() <<endl;
cout << "p2 " << setprecision(4) << p2.getx() << " " << p2.gety() <<endl;
cout << "p3 " << setprecision(4) << p3.getx() << " " << p3.gety() <<endl;
}
함수 오버로드를 확인할 수 없다는게 뭐죳
영어 비주얼스튜디오 쓰시구요. 오류메세지로 구글링 해보세요^^
ㄴ 했는데 뭔소린지 못알아 먹겠습니다^^ 미개^^
리플도 남기고 하는거보니까 글을 다시 읽나본데... 그 주석달아놓은위치에 endl;을 써농은 이유가 뭐에요?
ㄴ 그러고보니 endl;이 혼자 있네요.... 감사합니다....
여기 분위기모르고 나댔습니다 살려주세욧