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 the difference between const volatile int i & volatile const int j;

2 Answers   HCL,


What will be your course of action for a push operation?

0 Answers  


write a program to display the numbers in the following format 4 4 3 3 3 3 2 2 2 2 2 2 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 2 2 2 2 2 3 3 3 4

9 Answers   IBM, NIIT, Winit,


What is assignment operator?

0 Answers  


Explain what are the different data types in c?

0 Answers  






What is static volatile in c?

0 Answers  


What is string length in c?

0 Answers  


What is difference between union and structure in c?

0 Answers  


What are the usage of pointer in c?

0 Answers  


What are unions in c?

0 Answers  


Write a progarm to find the length of string using switch case?

0 Answers   TCS,


write a program to fined second smallest and largest element in a given series of elements (without sorting)

9 Answers   Yahoo,


Categories