Copying array into another array?

Nov 18, 2013 at 5:31am
have this code that will copy the elements from an array to another array. This code is from the book but i'm not clearly understanding it. Importantly, the while part where the context illustrates that index <startingpos+numberofelements. What is it adding that??

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
void copyarray (int list[],int startingpos, int list2[],int tar, int numberelements)

{
	int index;
	index=startingpos;

while (index < startingpos+numberelements)
{
	list2[index]=list[tar];
	tar++;

	index++;
}


}
Nov 18, 2013 at 8:13pm
Double knock knock for this too :D
Topic archived. No new replies allowed.