c++学习

//类成员函数的定义
#include <iostream> using namespace std; void show();//普通函数的声明 void show() //普通函数的定义 { cout<<"你好世界"; } class human { public: void set(int x); //类成员函数的声明 void set(int x) //类成员函数在类内部定义的情况 { cin>>x; } } void human::set(int x) //类成员函数的定义在类外面定义的情况 { cin>>x; }

 

posted on 2015-03-13 21:17  rule the world  阅读(80)  评论(0编辑  收藏  举报