M
michael
Hi All,
if I have an array and I pass it to a function and I want the function to
substitute a new array for the one that was passed like:
void append(int a1[], int &size1, int someNumber){
int *temp;
temp = new int[size1 + someNumber];
size1 += someNumber;
a1 = temp; //I know this is wrong but can't figure out what to do
instead
}
how do I do the assignment? The arrays are passed as pointers aren't they?
Thanks for your help
Michael
if I have an array and I pass it to a function and I want the function to
substitute a new array for the one that was passed like:
void append(int a1[], int &size1, int someNumber){
int *temp;
temp = new int[size1 + someNumber];
size1 += someNumber;
a1 = temp; //I know this is wrong but can't figure out what to do
instead
}
how do I do the assignment? The arrays are passed as pointers aren't they?
Thanks for your help
Michael