C++ Expression Must Have A Class Type error : I am writing a disjoint set class in c++ and I keep getting this error: Expression must have a class type

The class looks like this:

    class DisjointSet{
    private:
    	int *array;
    	int size;
    public:
    
    	void make_set(int elements){
    		array = new int[elements];
    		for (int i = 0; i < array.length; i++) {
    			array[i] = i;
    			size += 1;
    		}
    	}

and the error comes up when i try to get array.length in the for loop. I tried using the -> operator instead but I'm not sure why this is an issue...