分享

notes for C++ tutorial for C users

 吴家小院 2011-12-16
C++   简单的语法上的介绍。

1. static
One or more variables in a class can be declared static. In which case, only one instance of those variables exist, shared by all instances of the class. It must be initialised outside the class declaration :

2. const
A class variable can also be constant. That's just like static, except it is given a value inside the class declaration and that value cannot be modified:

3. virtual method
(If at least one of the methods of the base class is virtual then a "header" of 4 bytes is added to every instance of the classes. This allows the program to determine what a vector actually points to.) (4 bytes is probably implementation specific. On a 64 bit machine maybe it is 8 bytes...)




    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多