12345678910111213141516171819
#include "stdafx.h" #include "Radix.h" using namespace std; Radix::Radix(int cols) { zeroArrayPtr = new vector< vector <int> >; negArrayPtr = new vector< vector <int> >; if (zeroArrayPtr->size() == 0) { createArrays(cols); } } void Radix::createArrays(int cols)
1234567891011121314151617181920212223
#ifndef RADIX_H #define RADIX_H #include <iostream> #include <math.h> #include <vector> #include <stack> using namespace std; class Radix { public: Radix(int cols); private: void createArrays(int cols); static vector<vector<int> > *zeroArrayPtr; static vector<vector<int> > *negArrayPtr; }; #endif // RADIX_H
12
vector<vector<int> >* Radix::zeroArrayPtr; vector<vector<int> >* Radix::negArrayPtr;
std::unique_ptr< std::vector<std::vector<int> > > zeroArrayPtr;