C passes By value or By reference?
Answers were Sorted based on User's Feedback
Answer / rasheed
yes C passes Both by value and reference.
but strictly speaking C passes only both by value
| Is This Answer Correct ? | 6 Yes | 0 No |
Answer / rohit
it depends on us how to pass a value
because ,c can pass by both value and reference
by valu means actual val of variable ia passed
by reference address of the required value is passed
| Is This Answer Correct ? | 3 Yes | 1 No |
Answer / red dustbin
C passes only by value. When passing a pointer, the pointer
is passed by value. This is equivalent to passing by
reference but it is the progammer's choice to pass the
pointer instead of the object itself.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / ravi chandra
pass by value means passing values to the function
values means numericals
and pass by reference means passing addresses of the values..
fun(int a ,int b ) //pass by value
fun(int *a,int *b)// pass by reference
pass by reference
fun(int &a,int &b)
{
}
fun(int *c,int *d) // *c=*(&a) ,*d=*(&b)
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / k.thejonath
C passes to functions by both value and by reference.
Passing by value, "you just send a variable" and by
refernce means, by passing pointer.
| Is This Answer Correct ? | 2 Yes | 3 No |
how to find anagram without using string functions using only loops in c programming
How can I implement sets or arrays of bits?
Explain threaded binary trees?
What are header files why are they important?
program to find error in linklist.(i.e find whether any node point wrongly to previous nodes instead of next node)
Evaluate the following: int fn(int v) { if(v==1 || v==0) return 1; if(v%2==0) return fn(v/2)+2; else return fn(v-1)+3; } for fn(7); 1) 10 2) 11 3) 1
void main() { int a[]={1,2,3,4,5},i; for(i=0;i<5;i++) printf("%d",a++); getch(); }
please give me answer with details #include<stdio.h> main() { int i=1; i=(++i)*(++i)*(++i); printf("%d",i); getch(); }
What does == mean in texting?
What is union and structure?
Find the O/p of the following 1) #include int main() { char c='1'; int j=atoi(c); }
define function