C passes By value or By reference?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I insert or delete a line (or record) in the middle of a file?

568


Describe the steps to insert data into a singly linked list.

615


Was 2000 a leap year?

620


What is calloc in c?

654


What are logical errors and how does it differ from syntax errors?

650






How does normalization of huge pointer works?

622


What are register variables? What are the advantage of using register variables?

672


Explain what are preprocessor directives?

621


Why is structure padding done in c?

637


What are the applications of c language?

619


When do we get logical errors?

632


What does a function declared as pascal do differently?

601


What is difference between Structure and Unions?

633


Explain what does the function toupper() do?

628


What is the difference between #include

and #include “header file”?

544