driver.cc
#include <iostream>
#include "dynStack.h"
using namespace std;
// class definition
int main()
{
dynstack<int> c1;
c1.push(1);
cout<<"hello";
return 0;
}
dynStack.h
#include <iostream>
using namespace std;
template <class T>
class dynstack
{
public:
dynstack();
void push(T data);
};
dynStack.cc
#include "dynStack.h"
template <class T>
dynstack<T>::dynstack()
{
}
template <class T>
void dynstack<T>::push(T data)
{
return data;
}
I'm new to C++. When I run the code, it keeps giving me "undefined reference to 'dynstack::dynstack()' error. I checked include and prototype and couldn't spot the error. Could anyone help me find where I did wrong? Thank you.