Member function undefined in separate file

I have three files.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//headerfile NumArrSpecs.h

#ifndef NUMARR_H
#define NUMARR_H

class NumArr
{
private:
	double *arrptr;

public:
	NumArr(int nums)
	{
		arrptr = new double [nums];
	}

	void storeElems(int, double);
};

#endif 

File 2:
1
2
3
4
5
6
7
//file to define member functions
#include "NumArrSpecs.h"

void NumArr::storeElems(int e, double v)
{
	arrptr[e] = v;
}

file 3:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include "NumArrSpecs.h"
#include <iostream>

int main()
{
	NumArr test(5);

	double userVal = 0.0;
	for(int count = 0; count < 5; count++)
	{
		storeElems(count, userVal);
	
	}
}

My problem is that the storeElems member function is causing an error saying it is undefined, however there are no errors any where else in the program being reported. I have made several programs involving classes now, all with this three file format and this is the first time that a member function in the main file is being reported as undefined, so I'm not sure what to do. thanks for the help
Your class is called class NumArr. So why is this - #include "NumArrSpecs.h" in the other 2 files? There is nothing called NumArrSpecs. You want to

#include "NumArr.h"
Actually I realized I forget to include the calling object so it should be:
test.storeElems(count, userVal);
Topic archived. No new replies allowed.