diff --git a/面向对象体系架构.cpp b/面向对象体系架构.cpp new file mode 100644 index 0000000..b6ddd79 --- /dev/null +++ b/面向对象体系架构.cpp @@ -0,0 +1,38 @@ +#include +#include +using namespace std; +class Point +{ + public: + void setPoint(string a,int b,string c); //�����ڶԳ�Ա������������ + void printPoint(); + + private: + string name; + int age; + string sex; +}; + +void Point::setPoint(string a,int b,string c) //ͨ������������� '::' ʵ��setPoint���� +{ + name=a; + age=b; + sex=c; +} + +void Point::printPoint() //ʵ��printPoint���� +{ + cout<< "name = " << name << endl; + cout<< "age= " << age << endl; + cout<<"sex="<