pinsickle 17 Junior Poster in Training
class Array
{
    public:
        Array
            (int newSize, int order);
        Array
            (const Array& original);
        ~Array
            (void);
        void write
            (ostream& outfile, char* sortName, char* orderName);
        
        int getSize (void);

        void insertionSort (void);
        
        void selectionSort (void);

        void bubbleSort (void);
        
        static void initShellH (void);
        
        void shellSort (void);
        
        void heapSort (void);
        
        void quickSort (void);
        
        void mergeSort (void);
        
        void radixSort (void);
        
    private:
        void swap
            (int& a, int& b);
            
        void moveHeapDown (int first, int last);
        
        void quickSort (int first, int last);
        
        void mergeSort (int first, int last);
        
        void merge (int first, int last);
        
        void addToTemp(int*& assigned, int assignTo);
        
        int* data;
        int size;
	static int shellH [22];

};
void Array::initShellH (void)
    {
        int numSkip = 1;// smallest shell increment is one
        
        for (int i = 0; i < 22; i++)
        {
            shellH[i] = numSkip;
            numSkip = numSkip * 3 + 1;// suggested subsequent increments are 3*previous + 1          
        }
        return;
    } // end method

when I call shellH[] in my method it doesn't recognize it (missing symbols error). Do I need to move the shellH declaration to my .cpp file, or am I just doing something else wrong?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.