c++中 static修饰修饰类声明部分

来源:互联网 发布:白岩松事件犯众怒知乎 编辑:程序博客网 时间:2024/06/07 00:23

xx.h

#include <vector>
class Example
{
public:
    static const double rate;
    static const int vecSize = 2;
    static vector<double> vec;
};

xx.c
#include <iostream>
#include <stdlib.h>
#include "Tan.h"
using namespace std;
const double Example::rate = 2.1;
vector<double> Example::vec(vecSize);


void main()
{

}
0 0
原创粉丝点击