vs2010编译C++ 对象的使用

// CTest.cpp : 定义控制台应用程序的入口点。
//

#include "stdafx.h"
#include <iostream>
using namespace std;

class Circle{
    private:
        double x,y,r;
    public:
        void display(){
            cout<<"圆心:("<<x<<","<<y<<")"<<endl;
        }
        void set(double x1,double y1,double r1){
            x = x1;
            y = y1;
            r = r1;
        }
};
int _tmain(int argc, _TCHAR* argv[])
{
    Circle p1,p2;//初始化实体类
    p1.set(0,2,2);
    p1.display();
    p2= p1;     //将对象p1赋给p2
    p1.display();

    system("pause");
    return 0;
}
原文地址:https://www.cnblogs.com/bksqmy/p/4523822.html