Explain the pointers for inter-function communication in C language.

CServer Side ProgrammingProgramming

We know that functions can be called by value and called by reference.

  • If the actual parameter should not change in called function, pass the parameter-by value.
  • If the value of actual parameter should get changed in called function, then use pass-by reference.
  • If the function has to return more than one value, return these values indirectly by using call-by-reference.


Following is the C program for the demonstration of returning the multiple values −

 Live Demo

void main() {
   void areaperi(int,int*,int*);
   int r;
   float a,p;
   printf("enter radius of circle:\n");
void areaperi(int x,int *p,int *q) {
   *q=2 * 3.14*x;


When the above program is executed, it produces the following output −

Enter radius of circle: 5


  • Pointers have a type associated with them. They are not just pointer types, but rather are the pointer to a specific type.
  • The size of all pointers is same, which is equal to size on int.
  • Every pointer holds the address of one memory location in computer, but the size of a variable that the pointer refers can be different.
Updated on 25-Mar-2021 08:23:57