What is the difference function call by value & function
call by reference?
Answers were Sorted based on User's Feedback
Answer / nakul sharma
In Call by value we simply passes the variable to the
function but in CAll by reference we actually pass the
memory address where the variable we want to pass is stored.
| Is This Answer Correct ? | 9 Yes | 0 No |
Answer / sona
In call by reference we provide address of another variable
In call by value we directly assigned value to variable
| Is This Answer Correct ? | 9 Yes | 1 No |
In call by value,the function arguements will be duplicated
and sent to the called function from the function which is
calling it.
In call by reference ,the function arguements' address will
be passed to the called function by the calling function.
This method is the best practice since address is passed
rather than value.
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / rahul
In call by value function, the value of the actual
parameters or arguments from calling function is passed on
to the called functions i.e. actual value is copied into the
formal parameters of called function. The arguments passed
may be variables of any data type or constants also.
In call by reference, the address of actual parameters are
passed on to the called functions from calling functions.
So, the values stored in these memory locations can be
altered, which is reflected in calling functions also.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / sangeetha
In call by value, the changes made in the formal arguments
does not affect the actual argument
In call by reference, the changes made in the formal
arguments does affect the actual argument
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / abirami
function call by refernce will be begin with "&" symbols.i
think sooo..
but i dont know to explain function call by values!!!!!!!
| Is This Answer Correct ? | 3 Yes | 5 No |
34.what are bitwise shift operators? 35.what are bit fields? What is the use of bit fields in a structure declaration? 36.what is the size of an integer variable? 37.what are the files which are automatically opened when a c file is executed? 38.what is the little endian and big endian? 39.what is the use of fflush() function? 40.what is the difference between exit() and _exit() functions? 41.where does malloc() function get the memory? 42.what is the difference between malloc() and calloc() function? 43.what is the difference between postfix and prefix unary increment operators?
Explain what are preprocessor directives?
Look at the Code: main() { int a[]={1,2,3},i; for(i=0;i<3;i++) { printf("%d",*a); a++; } } Which Statement is/are True w.r.t the above code? I.Executes Successfully & Prints the contents of the array II.Gives the Error:Lvalue Required III.The address of the array should not be changed IV.None of the Above. A)Only I B)Only II C)II & III D)IV
What is masking?
Write a main() program that calls this function at least 10 times. Try implementing this function in two different ways. First, use an external variable to store the count. Second, use a local variable. Which is more appropriate?
O,T,T,F,F,S,S,E,N,?,?,?,T,F,F,S,S,E,N
What is string function c?
Write an implementation of “float stringToFloat(char *str).” The code should be simple, and not require more than the basic operators (if, for, math operators, etc.). • Assumptions • Don’t worry about overflow or underflow • Stop at the 1st invalid character and return the number you have converted till then, if the 1st character is invalid return 0 • Don’t worry about exponential (e.g. 1e10), instead you should treat ‘e’ as an invalid character • Write it like real code, e.g. do error checking • Go though the string only once • Examples • “1.23” should return 1.23 • “1a” should return 1 • “a”should return 0
if function is declared as static in one source file, if I would like to use the same function in some other source file...is it possible....how ?
What is the output for the program given below typedef enum grade{GOOD,BAD,WORST,}BAD; main() { BAD g1; g1=1; printf("%d",g1); }
What are the different categories of functions in c?
write a programe returns the number of times the character appears in the string