有关C++类知识

作者在 2015-08-07 22:31:56 发布以下内容

类的声明与组成

    类的概念:类就是数据和函数的封装体。

                    eg:

                           class rect{

                              private:

                                    float  x, y;

                               public:

                                    void set(float a, float b);

                                    float perimeter();

                                    float area();

                            };

C++编程 | 阅读 2121 次
文章评论,共0条
游客请输入验证码
浏览12419次
最新评论