Unknown error message C2440 in C++
<p>So when I try to run my header file in Unix, I get an error saying "error C2440: 'initializing' : cannot convert from 'std::vector&lt;_Ty> *' to 'std::vector&lt;_Ty>'". I think I'm getting this error because of the "transform" I'm calling in allOperations, but I'm not sure. Here's the header file: </p>

<pre><code>#include &lt;iostream&gt;
#include &lt;vector&gt;
#include &lt;string&gt;
#include &lt;fstream&gt; //library for files
#include &lt;cctype&gt;
#include &lt;algorithm&gt;
#include &lt;iterator&gt;
#include &lt;sstream&gt;
#include &lt;typeinfo&gt;


using namespace std;

template &lt;class T&gt;
void alloc3DArray(T *** &amp;x, int numberOfRows, int numberOfColumns,int numberOfDepth  )
{

 int i=0;
 int j=0;
 int k=0;


 // allocate an array for array of arrays
  x = new T ** [numberOfRows];


 // Allocate an array for each element of the first array
   for(i = 0; i &lt; numberOfRows; i++)
    {

        x[i] = new T *[numberOfColumns];

  // Allocate an array of T for each element of this array
        for(j = 0; j &lt; numberOfColumns; j++)
        {

            x[i][j] = new T [numberOfDepth];

   // Specify an initial value 
   for(int k = 0; k &lt; numberOfDepth; ++k)
   {
    x[i][j][k] = -1;


   }


        }
    }

}

template &lt;class T&gt;
void dealloc3DArray(T *** &amp;x, int numberOfRows, int numberOfColumns )

{
 // Check if it exeists 
 if(!x) //it does not exist
         exit(1);



    for (int i = 0; i &lt; numberOfRows; ++i) 
    {
   for (int j = 0; j &lt; numberOfColumns; ++j)

        {
    //delete innest
            delete [] x[i][j]; 
        }

   //delete columns
        delete [] x[i];
    }
 //delete first array
    delete [] x;
}

template &lt;class T&gt;
const vector&lt;T&gt;  allOperationsNotWorking(T *** &amp;myArray1, T *** &amp;myArray2,  T *** &amp;myArray3,int numberOfRows, int numberOfColumns,int numberOfDepth  )

{
    int i=0;
 int j=0;
 int k=0;

    int size = numberOfRows * numberOfColumns * numberOfDepth; //find vector size
    vector&lt;T&gt; &amp;myvector = vector&lt;T&gt;(size);// create a vector
    //vector&lt;T&gt;::const_iterator it;// const_iterator is faster than iterator
    for(i = 0; i &lt; numberOfRows; i++)
   for(j = 0; j &lt; numberOfColumns; j++)
    for(k = 0; k &lt; numberOfDepth; k++){

     myArray3[i][j][k] =myArray1[i][j][k]+myArray2[i][j][k];

     myvector.push_back(myArray3[i][j][k]);


    }
     return myvector;


}

vector&lt;string&gt;  allOperationsString(string *** &amp;myArray1, string *** &amp;myArray2,  string *** &amp;myArray3,int numberOfRows, int numberOfColumns,int numberOfDepth  )

{
    int i=0;
 int j=0;
 int k=0;

    int size = numberOfRows * numberOfColumns * numberOfDepth; //find vector size
    vector&lt;string&gt; myvector = vector&lt;string&gt;(size);// create a vector
    //vector&lt;T&gt;::const_iterator it;// const_iterator is faster than iterator
    for(i = 0; i &lt; numberOfRows; i++)
   for(j = 0; j &lt; numberOfColumns; j++)
    for(k = 0; k &lt; numberOfDepth; k++){

     myArray3[i][j][k] =myArray1[i][j][k]+myArray2[i][j][k];

     myvector.push_back(myArray3[i][j][k]);


    }
     return myvector;


}

template &lt;class T&gt;
vector&lt;T&gt; isWord(vector&lt;T&gt; &amp;stringVector, vector&lt;T&gt; &amp;goodOnes,vector&lt;T&gt; &amp;badOnes, vector&lt;T&gt; &amp;dict)
{
    vector&lt;int&gt; strV;


 if (typeid(stringVector).name()== typeid(strV).name()){

 //if (typeid(stringVector)==int){
  ofstream badFile; //  declare and object as output file  using ofstream
  cout &lt;&lt; " Illegal Vector" &lt;&lt; endl;
  badFile.open ("hw1bout2.txt", ios::app);
  badFile &lt;&lt; "Illegal Vector" &lt;&lt; endl;
  badFile.close();
  return badOnes;
  }

 int i=0;
 int j=0;
 int FIRSTSIZE=stringVector.size();
 int SECONDSIZE = dict.size();
 std::string sInput="";
 std::string sDict="";

 sort(stringVector.begin(), stringVector.end());//sort() uses quicksort from the algorith library

  for(int i=0, j=0; i &lt; FIRSTSIZE &amp;&amp; j &lt; SECONDSIZE; ){
   sInput=stringVector[i];


   std::transform(sInput.begin(), sInput.end(), sInput.begin(), std::toupper); //convert input word to upper

   sDict=dict[j];


   if(sInput.compare(sDict) == 0) {
   goodOnes.push_back(stringVector[i]); //write good word to vector

   i++;//advance one position in string vector
   j++;//advance one position in dictionary
    }

  else if(stringVector[i] &lt; dict[j] &amp;&amp; FIRSTSIZE &lt; SECONDSIZE){// wrods did not match
   if (stringVector[i].size() &gt;0) badOnes.push_back(stringVector[i]); //write bad word to vector if not empty string
   i++;//advance one position in string vector
   }

  else{
   j++;//advance one position in dictionary
    }
}



 return goodOnes;
}

template&lt;class T &gt;    
vector&lt;string&gt; isWord(vector&lt;int&gt; &amp;stringVector, vector&lt;string&gt; &amp;goodOnes,vector&lt;string&gt; &amp;badOnes, vector&lt;string&gt; &amp;dict)
{

 vector&lt;int&gt; strV;


 if (typeid(stringVector).name()== typeid(strV).name()){

  badOnes.push_back("Illegal Vector" );
 }
  return badOnes;

}

//template&lt;class T&gt;
vector&lt;int&gt;  allOperations(int *** &amp;myArray1, int *** &amp;myArray2,  int *** &amp;myArray3,int numberOfRows, int numberOfColumns,int numberOfDepth  )

{
    int i=0;
 int j=0;
 int k=0;

    int size = numberOfRows * numberOfColumns * numberOfDepth; //find vector size
    vector&lt;int&gt; myvector = vector&lt;int&gt;(size);// create a vector
    //const vector&lt;int&gt;&amp; myvector;
    //vector&lt;int&gt;::const_iterator it = myvector.begin();
    vector&lt;int&gt;::const_iterator it;// const_iterator is faster than iterator
    for(i = 0; i &lt; numberOfRows; i++)
   for(j = 0; j &lt; numberOfColumns; j++)
    for(k = 0; k &lt; numberOfDepth; k++){

     myArray3[i][j][k] =myArray1[i][j][k]+myArray2[i][j][k];

     myvector.push_back(myArray3[i][j][k]);


    }
     return myvector;


}
</code></pre>
