Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
5Activity
0 of .
Results for:
No results containing your search query
P. 1
12 ES 26 - Arrays on Functions

12 ES 26 - Arrays on Functions

Ratings: (0)|Views: 332|Likes:
Published by Wilmarc

More info:

Published by: Wilmarc on Aug 28, 2009
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

08/15/2010

pdf

text

original

 
 
Introduction to Programming
Arrays on FunctionsArrays on Functions
1212
 
 
Introduction to Programming
 Assignment Operator Assignment Operator
 Assignment operator does not work on arraysas it is on variables.
int a[] = {1,2}, b[] = {2,3,4};b = a;
and
now refer to the same array which wasoriginally just
. A change in either reflects to both.
 
 
Introduction to Programming
Passing Arrays to FunctionsPassing Arrays to Functions
 A function that accepts an int array as parameteris declared as follows:
change_array(int formal[], int size);
Note that
change_array 
has no way of knowing
formal 
's size (number of elements) just by thearray itself.Passing an array to the above function can beillustrated as follows:
int actual[2] = {1,2};change_array(actual,2);

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->