Return by address normally returns an argument passed to the function by address. - C Function

C examples for Function:Function Return

Introduction

The variable returned should not be a local variable since the memory to these variables is released when the function ends.

Demo Code

#include <stdio.h>
int* byAdr(int* i) { (*i)++; return i; }

int main(void) {
  int a = 10;// www  . java  2s .com
  int *p = byAdr(&a);
  printf("%d", *p); /* "11" */
}

Related Tutorials