Cody Caughlan schrieb:
Quote:
> > I need assign values from arr1to another array arr2 ->
> > arr2[24]={0,1,2,3,4,5,............24} accordingly
Be careful, because this is not exactly correct. For an array of size 24
you need 24 initialisers, not 25 as you indicate. IOW use 0 to 23.
Quote:
> > like int arr2[0]=arr1[0];
> What you want is to loop through each element of the array and assign each value
> the same in each array. For example - in your array of 24 elements:
> for(k = 0;. k < 24; k++)
> arr1[k] = arr2[k];
The concept is sound, but two little bugs managed to sneak in:
- there is a '.' after the first ';' in the "for"
- you got "arr1" and "arr2" the wrong way round in the assignment
Stephan
(initiator of the campaign against grumpiness in c.l.c)
(-: A brandnew excellent FAQ version has been released !!! :-)
(-: Get it: http://www.eskimo.com/~scs/C-faq/versions.html :-)