Skip to content

Latest commit

 

History

History
18 lines (16 loc) · 557 Bytes

7.58.md

File metadata and controls

18 lines (16 loc) · 557 Bytes
// example.h
class Example {
public:
  static double rate; // = 6.5;
  // static member should be initialize ouside class
  static const int vecSize = 20;
  static vector<double> vec; //(vecSize);
  // 1. cannot use parentheses as in-class initializer
  // 2. static member should be initialize ouside class
};

// example.C
#include "example.h"
double Example::rate = 6.5;
// should initialize static data member
vector<double> Example::vec(vecSize);
// should initialize static data member