Can someone help me with copying arrays

trigg

Beta member
Messages
1
this is what I have so far and I want to make a copy of the first array to copy_arr using array notation.

int main()
{
double source[10] = {240.5, 300.0, 189.6, 310.6, 280.7, 216.9, 199.4, 160.3, 177.4, 192.3};
double target1[10];
double target2[10];
copy_arr(source, target1, 10);
copy_ptr(source, target2, 10);

}
 
what language is it

c# is:

Array.Copy(SourceArray,DestinationArray,numberOfPositions);

jack
<< Please use a signature >>
 
Code:
void copy_arr(double source[], double target[], int number)
{
        int i;

        for(i=0;i<number;i++)
                target[i] = source[i];
}

is that what you wanted?
 
Back
Top Bottom