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

Tell me can the size of an array be declared at runtime?

594


Can a variable be both constant and volatile?

558


Explain main function in c?

622


Why static is used in c?

618


Why void is used in c?

561






GIven a sequence of characters. How will you convert the lower case characters to upper case characters. ( Try using bit vector - sol given in the C lib -> typec.h)

678


What is abstract data structure in c?

524


What is sorting in c plus plus?

563


I need a help with a program: Write a C program that uses data input in determining the whole of points A and a whole of circles B. Find two points in A so that the line which passes through them, cut through the maximum number of circles.

1490


What is time complexity c?

564


What are c preprocessors?

672


Why doesnt long int work?

610


what do u mean by Direct access files? then can u explain about Direct Access Files?

1637


What are preprocessor directives in c?

630


What functions are used for dynamic memory allocation in c language?

597