C passes By value or By reference?

Answers were Sorted based on User's Feedback



C passes By value or By reference?..

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

C passes By value or By reference?..

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

C passes By value or By reference?..

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

C passes By value or By reference?..

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

C passes By value or By reference?..

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

Post New Answer

More C Interview Questions

What is ctrl c called?

0 Answers  


WHAT IS MEANT BY LIFE?

2 Answers  


Diff: between this 2 classes in terms of memory class A { int i; char c; double d; }; class A { double d; int i; char c; }; How it is calculating?

1 Answers   HCL,


main() { int i = -3,j=2,k=0,m; m= ++i || ++j && ++k; printf("%d%d%d",i,j,k,m); }

7 Answers   HCL,


What is pass by reference in c?

0 Answers  






Do you know what is the purpose of 'extern' keyword in a function declaration?

0 Answers  


what is diognisis?

1 Answers  


write a program for odd numbers?

15 Answers  


What is the use of a semicolon (;) at the end of every program statement?

1 Answers  


void main() { static int i = 5; if(--i) { main(); printf("%d ",i); } } what would be output of the above program and justify your answer? }

5 Answers   C DAC, CDAC, Infosys, Wipro,


How to swap two values using a single variable ? condition: Not to use Array and Pointer ?

6 Answers  


using for loop sum 2 number of any 4 digit number in c language

0 Answers  


Categories