Pointers

I am getting an error message LNK2019 unresolved external symbol, and IntelliSense: more than one instance of overload function "addNumber"
What am I doing wrong? Here is my code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Lab 10 VarArray
// Erik Ohlin
// CS 13001
// 3/20/13

#include <iostream>
#include "VarArray.h"
using namespace std;

int main(){
	int *arrayPtr;
	char done, operation;

	cout << "done? <y/n> ";
	cin >> done;
	if(done == 'n' || done == 'N'){
		do{
			int number=0, size=0;
			arrayPtr=new int [size];
			cout << "add or remove? <a/r> ";
			cin >> operation;
			if(operation == 'a' || operation == 'A'){
				addNumber(arrayPtr, number, size);	
				}
		}while(done == 'n' || 'N');
	}
}

void addNumber(int *ptr, int num, int arraySize){
	arraySize++;
	ptr=new int [arraySize];
	cout << "input number: ";
	cin >> num;
	for(int i=0;i<arraySize;i++)
		ptr[i]=num;
	delete ptr;

}


Heres the header file:

1
2
3
void addNumber(int *& arrayPtr, int number, int &size);
void removeNumber(int *& arrayPtr, int number, int &size);
void output(int *arrayPtr, int size);
1
2
void addNumber(int *&
void addNumber(int *


There. Different definitions.
Topic archived. No new replies allowed.