Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 06-14-2004, 11:43 PM   #1
Beta Member
 
Join Date: Jun 2004
Posts: 1
Default Can someone help me with copying arrays

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);

}
__________________

trigg is offline   Reply With Quote
Old 06-18-2004, 06:14 PM   #2
Baseband Member
 
Join Date: Jun 2004
Posts: 49
Default Re: Can someone help me with copying arrays

what language is it

c# is:

Array.Copy(SourceArray,DestinationArray,numberOfPo sitions);

jack
<< Please use a signature >>
__________________

jackster is offline   Reply With Quote
Old 07-18-2004, 12:38 PM   #3
In Runtime
 
0x54's Avatar
 
Join Date: Jul 2004
Posts: 157
Default

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?
0x54 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 08:38 AM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0