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

Which type of language is c?

0 Answers  


What are global variables and how do you declare them?

0 Answers  


What is the relationship between pointers and data structure?

0 Answers  


What is non linear data structure in c?

0 Answers  


Can i use “int” data type to store the value 32768? Why?

0 Answers  






What is the hardest programming language?

0 Answers  


typedef enum { html, java, javascript, perl, cgi } lang;The above statement defines a : a) Union b) User defined type c) Enumerated variable d) none

0 Answers  


how to make c program without a libary? e.g.#include<stdio.h> libary is not in c progaram.

2 Answers  


Explain what are compound statements?

0 Answers  


why in C,C++'s int size is 2 byte and .net(c#) int Size is 4 byte?

2 Answers  


Explain how do you print an address?

0 Answers  


Why we use void main in c?

0 Answers  


Categories