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 can I find out how much memory is available?
Expand the following LKB BKL FFG
will the program compile? int i; scanf(“%d”,i); printf(“%d”,i);
main() { int a=5; printf(?%d,%d,%d\n?,a,a< <2,a>>2); } Answer: 5,20,1 please explain this code in detail
Can the curly brackets { } be used to enclose a single line of code?
Write a program which has the following seven functions. The functions should be: • main() this calls the other 6 functions • fget_long() a function which returns a long data type from a file • fget_short() a function which returns a short integer variable from a file • fget_float() a function which returns a floating point variable from a file • fprt_long() a function which prints its single, long argument into a file • fprt_short() a function which prints its single, short argument into a file • fprt_float() a function which prints its single, floating point argument into a file. You should use fscanf() to get the values of the variables from the input (the file) and fprintf() to print the values to the other file. Pay attention to using the correct format for each of the data types.
wite a programme in c to linear search a data using flag and without using flags?
size maximum allocated by calloc()
how to go with this?
What is the difference between specifying a constant variable like with constant keyword and #define it? i.e what is the difference between CONSTANT FLOAT A=1.25 and #define A 1.25
how to find anagram without using string functions using only loops in c programming
write a C code to reverse a string using a recursive function, without swapping or using an extra memory.
9 Answers Motorola, TCS, Wipro,