what is the difference between call by value and call by
reference?
Answer Posted / mahesh
call by value
int fun(int a,int b);
int fun(int p,int q)
{
temp=p;
p=q;
q=temp;
}
call by reference
int fun(int &a,int &b);
int fun(int *a,int *b)
{
temp=*a;
*a=*b;
*b=temp;
}
call by value is with values n call by ref with adresses n
pointers...
| Is This Answer Correct ? | 5 Yes | 1 No |
Post New Answer View All Answers
What is %d used for?
Write a program to print "hello world" without using a semicolon?
What is the size of enum in c?
In which language linux is written?
I heard that you have to include stdio.h before calling printf. Why?
Which type of language is c?
How can you convert integers to binary or hexadecimal?
What is non linear data structure in c?
What is a double c?
What type is sizeof?
#include main() { int *p, *c, i; i = 5; p = (int*) (malloc(sizeof(i))); printf(" %d",*p); *p = 10; printf(" %d %d",i,*p); c = (int*) calloc(2); printf(" %d ",*c); }
Explain the use of 'auto' keyword in c programming?
What are keywords in c with examples?
What is restrict keyword in c?
What is cohesion and coupling in c?