Right Click to Search

Monday, April 12, 2025

Passing Array to Function in C


Passing Array to Function in C
Array Definition :
Array is collection of elements of similar data types .
Passing array to function :
Array can be passed to function by two ways :
  1. Pass Entire array
  2. Pass Array element by element
Let us discuss both of them one by one :
1 . Pass Entire array
  • Here entire array can be passed as a argument to function .
  • Function gets complete access to the original array .
  • While passing entire array Address of first element is passed to function , any changes made inside function , directly affects the Original value .
  • Function Passing method : "Pass by Address"

2 . Pass Array element by element
  • Here individual elements are passed to function as argument.
  • Duplicate carbon copy of Original variable is passed to function .
  • So any changes made inside function does not affects the original value.
  • Function doesn't get complete access to the original array element.
  • Function passing method is "Pass by Value"

Tags / Keywords : | ,

Stumble
Delicious
Technorati
Twitter
Facebook

0 Comments:

Post a Comment

Your Feedback :This is Growing Site and Your Feedback is important for Us to improve the Site performance & Quality of Content.Feel Free to contact and Please Provide Name & Contact Email

 

Learn C Programming Copyright © 2010 LKart Theme is Designed by Lasantha, Free Blogger Templates