Okay, so here's the link for the problem http://www.pic.ucla.edu/~nathan/cgi-bin/moin.cgi/la1
I'm having trouble on the first part.
For the first function
intialize_array: I'm confused on how I can get the print_array function to print out NA's.. If I just initialize all values in the array to a default value such as -1, then ask the print_array function to print out the values, the values will read 'NA'?
for example:
(initialize_array(int a[],int n1) {
for (int i =0; i < a[n1]; i++)
a[i] = -1;
a[n1] = n1;
Also, for the copy_array function.. i wasn't sure if i was approaching this right
copy_array(int a[], int n1, int b[], int n2);
for(int i =0; i < n1+1; i++)
b[i] = a[i];
b[n2] = n2;
thanks so much
2007-01-28
12:55:40
·
2 answers
·
asked by
Anonymous
in
Computers & Internet
➔ Programming & Design
thanks for your help, the n2 represents, the new position prompted from the user.. so a is the old pointer, b is the new pointer, n1 is the old position.,.
and i'm trying to create a new array with the old values, and then add the integer for the last value in the new array.. (as it shows in the output in the link)
2007-01-28
14:14:04 ·
update #1