I am trying to define an inherited class CheckMyArray
which inherits from InitMyArray
however it keeps coming up with
CheckMyArray.cpp: In method `CheckMyArray::CheckMyArray(int)':
CheckMyArray.cpp:6: no matching function for call to `InitMyArray::InitMyArray ()'
InitMyArray.h:15: candidates are: InitMyArray::InitMyArray(int)
InitMyArray.h:16: InitMyArray::InitMyArray(int, int)
InitMyArray.h:25: InitMyArray::InitMyArray(const InitMyArray &)
make: *** [CheckMyArray] Error 1
My code for Init and Check is
//child class of InitMyArray
#ifndef CHECKMYARRAY_H
#define CHECKMYARRAY_H
#include "InitMyArray.h"
class CheckMyArray : public InitMyArray
{
private:
int cVal;
public:
CheckMyArray(int);
void put(int, int);
};
#endif
#ifndef INITMYARRAY_H
#define INITMYARRAY_H
#include "MyArray.h"
class InitMyArray
{
private:
int arrSize;
int arrVal;
public:
/*constructors*/
InitMyArray(int);
InitMyArray(int, int);
/*Destructors*/
~InitMyArray();
/*member functions*/
int get(int);
int getSize();
};
#endif
please help, Im cant seem to figure this out.