could not deduce template argument for T[]
<p>now im getting another error..
error C2065:'temp' : undeclared identifier
i know that for temp i need to declare the type that the array is like int temp[]
but what if i dont know what it is.. it could be int for string or double..
how can i create a temp array not specifing what it should be</p>

<p>i added a mergesort function. </p>

<p>Here is my code:</p>

<pre>
    template
    void Mergesort(T& a, int first, int last);
    template
    void Merge(T& a, int first, int last);    
<code>
<pre>
int main()  
    {
        int num;
        cout > num;
        Array b(num);
        cout > b[i];
        cout <code>    // Copy the original array and sort it using Quicksort
    Array&lt;string&gt; bq(b);
    Quicksort(bq, 0, num-1);
    cout &lt;&lt; "\nElements sorted using quicksort:\n";
    for (int i=0; i&lt;num ; i++)  
     cout &lt;&lt; bq[i]&lt;&lt; " ";
    cout &lt;&lt; "\n";

     Array&lt;string&gt; bm(b);
Mergesort(bm, 0, num-1);
cout &lt;&lt; "\nElements sorted using mergesort:\n";
     for (int i=0; i&lt;num ; i++)  
 cout &lt;&lt; bm[i]&lt;&lt; " ";
cout &lt;&lt; "\n";
</code></pre>

<p><code></p>

<pre>
template
void Mergesort(T& a, int first, int last) 
{
    if (first 
void Merge(T& a, int first, int last) 
{
    int mid = (first + last) / 2;
    int one = 0, two = first, three = mid + 1;

while (two &lt;= mid &amp;&amp; three &lt;= last) // Neither sublist is done
    if (a[two] &lt; a[three])          // Value in first half is smaller
  temp[one++] = a[two++];
    else                            // Value in second half is smaller
  temp[one++] = a[three++];
while (two &lt;= mid)                  // Finish copying first half
    temp[one++] = a[two++];
while (three &lt;= last)               // Finish copying second half
    temp[one++] = a[three++];
for (one = 0, two = first; two &lt;= last; a[two++] = temp[one++]);
</code></pre>

<p>}

    //ARRAY.h</p>

using namespace std;

template&lt;class T&gt; class Array 
{
public:
    Array(int s);
    Array(int l, int h);

    Array(const Array&amp; other);
    ~Array();

    T&amp; operator[](int index);
    const T&amp; operator[](int index) const;

    int get_size() const {return arraySize;}

private:
    int low;
    int high;
    int arraySize; //size of array
    int offset; //to adjust back to an index of zero
    T *array_;

    void Copy(const Array&amp;);
};
</code></pre>
