Expected a class or namespace

I just started making constructors for my class and for some reason, my class keeps giving me the following errors:
-expected a class or namespace
-expected unqualified-id

Here is my code so far

main.cpp
1
2
3
4
5
6
7
8
9
10
#include <iostream>
#include "Vector.h"

using namespace std;

int main()
{
    cout << "Hello world!" << endl;
    return 0;
}


Vector.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#ifndef VECTOR_H
#define VECTOR_H

template <class T>
class Vector{
    private:
        T arr[];
    public:
        Vector();
        Vector(int n, const T& val);
        Vector(const Vector<T>& v);

        virtual ~Vector();
    protected:
};

#endif // VECTOR_H 


Vector.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "Vector.h"

template <class T>
cVector::Vector<T>(){
    arr = {};
}

template <class T>
Vector::Vector<T>(int n, const T& val){
    arr [n];
    for(int i = 0; i<n; i++){
        arr[i] = val;
    }
}

template <class T>
Vector::Vector<T>(const Vector<T>& v){
    arr = v;
}

Vector::~Vector(){
    //dtor
}


any help is welcomed
In Vector.cpp
1
2
3
cVector::Vector<T>(){ //line 4: typo `cVector'
Vector::Vector<T>(int n, const T& val){ //line 9: should be Vector<T>::Vector
Vector::~Vector(){ //line 21: Vector is a template 


In Vector.hT arr[]; //line 7: that's illegal, you must especify the size of the array
Thanks, that was a big help :D
Topic archived. No new replies allowed.