C - Functions - Discussion
You Are Here :: Home > C > Functions - Discussion
#include int main(){ int a=5,b=10; swap(a,b); printf("%d %d",a,b); return 0; } void swap(int a,int b){ int temp; temp =a; a=b; b=temp; }
Pass by value: In this approach we pass copy of actual variables in function as a parameter. Hence any modification on parameters inside the function will not reflect in the actual variable.
Discussion