Hi i have only skimmed your code but there are a couple of things that stand out as potential problems
1: in remove number:
with the first for loop you want the original size not size -1
, otherwise, if you try to remove the last number in array it won't be found.
void removeNumber(int *& array,int number, int &size)
{
IntArrayPtr temp;
size = size-1;
temp = new int[size];
for(int i=0;i<size;i++)
{
if(array[i] == number)
{
for(int j=i;j<size;j++)
{
array[j] = array[j+1];
}
}
}
so you need to add a variable say istop
that has the old size to use with the loop before you save the new size
The other issue won't be so obvious and may not matter for you usage, again addNumber has a size being used twice where different values are wanted. and output should leave array unaltered.