I've started to "port" my Java implementation of dynamic array to C++ and somehow i'm facing a strange linker error (LNK2019 and LNK2011) in my code, although i don't see any place which can produce such error. I think it has something to do with constructor, but i can't find what exactly. Thank you for your help!
DynStackArrayQueue.cpp (test class) :
#include <iostream>
#include "DynArray.h"
using namespace std;
int main()
{
DynArray dynA (3, 6);
}
DynArray.h
#pragma once
class DynArray {
private:
int growthFactor, maxOverhead;
int elements[];
public:
DynArray(int growthFactor, int maxOverhead);
}
DynArray.cpp
#include <iostream>
#include "DynArray.h"
using namespace std;
DynArray::DynArray(int growthFactor, int maxOverhead) {
this->growthFactor = growthFactor;
this->maxOverhead = maxOverhead;
}
The error itself: