When I'm trying to use constructor of my class, I get the following errors:
error C2955: 'myQueue' : use of class template requires template argument list
and
error C2512: 'myQueue' : no appropriate default constructor available.
This is a header file:
#ifndef myQueue_
#define myQueue_
template<typename type>
class myQueue{
public:
myQueue();
~myQueue();
type dequeue();
void enqueue(type t);
private:
int size;
type* arr;
int curSize;
};
#endif
And this is a cpp file.
#include "myQueue.h"
#include "genlib.h"
template<typename type>
myQueue<type>::myQueue()
{
size = 10;
arr = new type[size];
}
template<typename type>
myQueue<type>::~myQueue()
{
delete arr[];
arr = NULL;
}
trying to use this class here.
int main(){
myQueue a = new myQueue();
}