All pastes #387854 Raw Edit

Something

public cpp v1 · immutable
·published 2007-03-09 18:12 UTC
rendered paste body
// static members in classes#include <iostream>using namespace std;class CDummy {  public:    static int n;    CDummy () { n++; };    ~CDummy () { n--; };};int CDummy::n=0;int main () {  CDummy a;  CDummy b[5];  CDummy * c = new CDummy;  cout << a.n << endl;  delete c;  cout << CDummy::n << endl;  return 0;}