Why cant i overload the * operator? : <pre><code>#include &lt;iostream&gt;
#include &lt;string&gt;
using namespace std;


    class sequence{



    public:
    sequence();
    sequence(int x);
    sequence&amp; operator*=(const &amp;left, const &amp;right);
    ~sequence();
    friend istream&amp; operator &gt;&gt;(istream&amp;, sequence&amp;);
    friend ostream&amp; operator &lt;&lt;(ostream&amp;, sequence&amp;);


    void set_num_samples(); //Set no. of samples
    float* value;           //pointer to float variable
    void allocate_memory(); //Allocates memory
    void set_values_array(); //Sets the values of an array
    void check_array_input(float l); //Checks the values of the array
    void reset_input(float j); //Resets the array
    void de_allocate(); //deallocates memory

    int get_num_samples();
    void set_full_array(int x);
    void calculate_full(float array1[], float array2[]);

    void combine_seq_coef(sequence&amp; inputvoltageA); //Combines the passed      in sequence and coefficient
    void combine_seq(sequence&amp; objectcombine, int sample); // combine the sequences


    private:
    int num_samples;          //number of samples in the object sequence




    };

    class FIR{

    public:
    FIR();
    ~FIR();


    private:
    int num_coefficients;       //Number of coefficients in an FIR (filter impulse response)


      };



    //Constructor for each object

    void sequence::set_num_samples() {      //Set_num_sample definition

    cout &lt;&lt; "Please enter the number of values in your sequence: \n";

    cin &gt;&gt; num_samples;
    if(num_samples &lt; 0){


        cout &lt;&lt; "Value entered must be greater than 0 "&lt;&lt; endl;
        cout &lt;&lt; "Please enter the value again: " &lt;&lt; endl;
        cin &gt;&gt; num_samples;


    }


    };      //ok (stream op)

    void sequence::allocate_memory() {

    value = new float[num_samples]; //Allocated memory for Array.


}; //ok

    void sequence::set_values_array(){   //Set values for array

    int k;
    for(k=0; k&lt;num_samples; k++){


        cout &lt;&lt; "Please enter a positive value for element : " &lt;&lt; (k+1) &lt;&lt; endl;
        cin &gt;&gt; value[k];
        while(value[k] &lt; 0){

            cout &lt;&lt; "Enter positive value " &lt;&lt; endl;
            cin &gt;&gt; value[k];

        }
    }

    cout &lt;&lt; "Values have been assigned successfully! " &lt;&lt; endl;

}; //ok


    //Constructor functions

    void sequence::check_array_input(float l) {   //Checks array values.


    cout &lt;&lt; endl &lt;&lt; "If you would like to check input values, enter 'y' otherwise, enter 'n' to continue..." &lt;&lt; endl;
    char check_value;
    cin &gt;&gt; check_value;
    if (check_value == 'y') {

        int i;
        for (i = 0; i &lt; l; i++) {

            cout &lt;&lt; "Value no. " &lt;&lt; (i + 1) &lt;&lt; " is:" &lt;&lt; endl;
            cout &lt;&lt; value[i] &lt;&lt; endl;


        }
    }
    }
    void sequence::reset_input(float j) {   //Reset voltage value and set to 0;

    cout &lt;&lt; endl &lt;&lt; "If you would like to reset all input values, enter 'y' otherwise, enter 'n' to continue..."
    &lt;&lt; endl;

    char check_value2;
    cin &gt;&gt; check_value2;
    if (check_value2 == 'y') {
        int i;
        for (i = 0; i &lt; j; i++) {

            cout &lt;&lt; "Value no." &lt;&lt; (i + 1) &lt;&lt; ": " &lt;&lt; value[i];
            value[i] = 0;
            cout &lt;&lt; " is set to 0!" &lt;&lt; endl;


        }
    }
    }
     void sequence::de_allocate(){

    delete[] value; //De-allocate memory
    num_samples = 0;
    cout &lt;&lt; "De-allocation of input array successful, num of samples reset to 0! " &lt;&lt; endl;

}

int sequence::get_num_samples(){

    return num_samples;

}

/* void sequence::calculate_full(float array1[], float array2[]){


    int loop;
    for(loop=0; loop&lt;num_samples; loop++){

        cout &lt;&lt; "CoefficientA value no: " &lt;&lt; (loop+1) &lt;&lt; ": " &lt;&lt; array1[loop].value[loop] &lt;&lt; endl;
        cout &lt;&lt; "InputvoltageA value no." &lt;&lt; (loop+1) &lt;&lt; ": " &lt;&lt; array2[loop].value[loop] &lt;&lt; endl;

        value[loop] = (array1[loop].value[loop])*(array2[loop].value[loop]);
        cout &lt;&lt; "Combined value no. " &lt;&lt; (i+1) &lt;&lt; ": " &lt;&lt; value[loop] &lt;&lt; endl;



        cout &lt;&lt; "The combined value gives" &lt;&lt;  full[loop] &lt;&lt; endl;

    }


}; */

void sequence::set_full_array(int x){

    num_samples = x;


}


void sequence::combine_seq(sequence&amp; object_combine, int sample_num){

    int loop;
    for(loop=0; loop&lt;sample_num; loop++){




    }

};

sequence&amp; sequence::operator*=(const &amp;left, const &amp;right){


    int y = left.get_num_samples();
    int x;
    for (x=0; )
    sequence = left.value * right.value
    return sequence;

}

sequence::sequence(){    //SEQUENCE CONSTRUCTOR

    set_num_samples();
    allocate_memory();
    set_values_array();
    check_array_input(num_samples);
    reset_input(num_samples);
    de_allocate();
    cout &lt;&lt; endl &lt;&lt; "Constructor complete!" &lt;&lt; endl;

};

sequence::sequence(int a){ //sequence constructor 2

    set_full_array(a);
    allocate_memory();

}


/* sequence::sequence(int a){

    set_full_samples();
    allocate_memory();

    int i;
    for(i=0; i&lt;num_samples; i++){

        cout &lt;&lt; "CoefficientA value no: " &lt;&lt; (i+1) &lt;&lt; ": " &lt;&lt; coefficientA().value[i] &lt;&lt; endl;
        cout &lt;&lt; "InputvoltageA value no." &lt;&lt; (i+1) &lt;&lt; ": " &lt;&lt; inputvoltageA.value[i] &lt;&lt; endl;
        cout &lt;&lt; "Combined value no. " &lt;&lt; (i+1) &lt;&lt; ": " &lt;&lt; value[i] &lt;&lt; endl;

    }
}
 */






sequence::~sequence(){          //Destructor


    cout &lt;&lt; "Destructor is called" &lt;&lt; endl;



}; //destructor



int main(){

    // Create object, constructor called
    // Constructor calls, set_num_sample, allocate_memory, set_values_array
    // Enters values for voltage Inputs to the sequence into an array
    // Checks values of the array
    // Asks user if they want to reset values and set num samples = 0.


    do {
        cout &lt;&lt; "Press the Enter key to continue:" &lt;&lt; endl;
    } while (cin.get() != '\n');

    cout &lt;&lt; "Input voltage sequence created!" &lt;&lt; endl;
    sequence inputvoltageA;

    cout &lt;&lt; endl &lt;&lt; "CoefficientA sequence created!" &lt;&lt; endl;
    sequence coefficientA;

    //Combines sequence and coefficients

    cout &lt;&lt; "If you would like to combine the coefficients with the input sequence A enter 'y', otherwise enter 'n'" &lt;&lt; endl;

    char prompt4;
    cin &gt;&gt; prompt4;
    if(prompt4 == 'y'){

        int x = coefficientA.get_num_samples();
        sequence full(x);
        full = coefficientA*inputvoltageA;
    }





    /* Ask the user if they want to create new object
     cout &lt;&lt; "If you would like to create a new input voltage sequence enter 'y', otherwise enter 'n'" &lt;&lt; endl;
     char prompt3;
     cin &gt;&gt; prompt3;
     if(prompt3 == 'y'){
     sequence inputvoltageB;

     }


     cout &lt;&lt; "CoefficientA sequence created!" &lt;&lt; endl;
     sequence coefficientB;


     */



    /*

     cout &lt;&lt; "If you would like to combine this sequence with the sequence before enter 'y', otherwise enter 'n'" &lt;&lt; endl;
     char prompt5;
     cin &gt;&gt; prompt5;
     if(prompt5 == 'y'){


     combine_seq(inputvoltageA, num_samples);



     } */



    return 0;
}
</code></pre>

<p>Why cant i overload the * operator?
The compiler gives me the error c++ must have a type specifier.
My type specifier is a reference to a sequence object...
I think ive defined the overload operator * function correctly in the class and outside of it.</p>
