Engineering Science 1036A/B Lecture 15: Arrays: Passing Arrays to Functions

28 views3 pages
The name of the array and size is passed to the function
How to declare and invoke a function getting an array
Pass by Reference
Starting address of the array is passed to the formal parameter
Called pass by reference: only the name of the array is passed
The parameter inside the function references to the same array that is passed
to the function
No new array is created in this process
The new array name becomes the alias of the old array name
When passing an array to a function, the size should also be passed through a
another argument
A function definition header may use square brackets with or without indicating
the size of the array inside the brackets
Passing Arrays to Functions
Unlock document

This preview shows page 1 of the document.
Unlock all 3 pages and 3 million more documents.

Already have an account? Log in

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents