Invalid Types Error Using Container Class

I'm writing a program that takes in two sets of numbers and removes all elements of one set from the other set. I overloaded the - operator in order to do this. My error is:
 
invalid types `<unknown type>[int]' for array subscript //See driver program 

The class in my header file:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
    class set
    { 
    public:
        typedef size_t size_type;
	enum { CAPACITY = 30 }; 
        set( ) {used = 0;}
        set(int [], int);
        bool erase_one(const value_type& target);
        size_type size( ) const { return used; }
        bool set::contains(const value_type& target) const;
        value_type get_array(value_type x) const {return data[x];}
        value_type data[CAPACITY];           
    private:            
        size_type used;             
    };
    set operator -(const set& b1, const set& b2);

My implementation:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
    set::set(int array_input[], int counted)
    {
          used = counted;
          for(int x = 0; x > used; used++)
          {
               data[used] = array_input[used];
          }
    }

    bool set::erase_one(const value_type& target)
    {
         size_type index = 0;y    

	 while ((index < used) && (data[index] != target))
         {
              ++index;
         }
	 if (index == used)
	 {
              return false; 
         }
	 --used;
	 data[index] = data[used];    
	  return true;
    }

    bool set::contains(const value_type& target) const
    {
         size_type i;
         for(i = 0; i < used; i++)
         {
               if(target == data[i])
               {
                     return true;
               }
               else
               {
                     return false;
               }
         }
    }

    set operator-(const set& b1, const set& b2)
    {
         size_t index;
	 set answer(b1);  // copy constructor
	 size_t size2 = b2.size(); // use member function size 
	 for (index = 0; index < size2; ++index)
	 {
	      int target = b2.data[index];
	      if (answer.contains(target)) 
	      {
		answer.erase_one(target); 
              }
         }
	 return answer;
    }

What my driver program is trying to do:
1
2
3
4
5
6
7
    set first(array1, counter_one), second(array2, counter_two), subtraction;
    subtraction = first - second;
    
    for(int z = 0; z < subtraction.size(); z++)
    {
         cout << subtraction.get_array[z] << " "; //THIS IS WHERE THE ERROR IS
    }


Why am I getting this error and what can I do to fix it?
Any help is appreciated. Thanks!
You have used the wrong kind of parenthesizes when calling the get_array function ( [ ] instead of ( ) ).
What a silly mistake. Thanks!
Topic archived. No new replies allowed.