• 简单的一个类的存储空间


    /*
    对于此类的模型为:
    class object
    {
        float _x;//类的nonstatic成员函数
        _vptr_Point;//指向虚函数表的指针
    }
    
    virtual table//虚函数表的信息(应该存放的是一些指针)
    slot1---type info for Point(用于支持RTTI)
    slot2---~Point()
    slot3---print()
    
    类之外
    //成员函数
    Point::Point(float)
    float x() const
    
    //static函数
    static int PointCount()
    //static数据成员
    static int _point_count
    */
    #include <iostream>
    class Point    
    {
    public:
        Point(float xval);
        virtual ~Point();
    
        float x() const;
        static int PointCount();
    
    protected:
        virtual std::ostream& print(std::ostream& os) const;
    
        float _x;
        static int _point_count;
    };
  • 相关阅读:
    Dangling Javadoc comment
    IntelliJ IDEA :Error(1, 1) java 非法字符 'ufeff'
    什么是webhook
    智能DNS
    filebeat 乱码
    windows,交换机syslog收集
    Rsyslog
    ntp
    centos7 -lvm卷组
    nginx安装
  • 原文地址:https://www.cnblogs.com/zzyoucan/p/4007938.html
Copyright © 2020-2023  润新知