Right Click to Search

Sunday, August 1, 2024

Passing 1-D Array to Function Element by Element in C Programming


Passing 1-D Array to Function Element by Element in C Programming
  • Array Elements are passed to function "One by One".
  • Parameter Passing Method : Pass by Value
  • Actual Element is never Passed to Function , Instead it's Carbon Copy is Passed to Function
  • Function Body Cannot Modify Original Value.
  • Example :
#include<stdio.h>
void show(int b[3]);
void main()
{
int arr[3] = {1,2,3};
int i;
for(i=0;i<3;i++)
  show(arr[i]);
}
void show(int x)
{
printf("%d ",x);  
}

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