#include <stdio.h>
void addOne(int* ptr) {
(*ptr)++; // adding 1 to *ptr
}
int main()
{
int* p, i = 10;
p = &i;
addOne(p);
printf("%d", *p); // 11
return 0;
}
void f(void (*a)()) {
a();
}
void test() {
printf("hello world
");
}
int main() {
f(&test);
return 0;
}
#include <stdio.h>
void getDoubleValue(int *F){
*F = *F + 2;
printf("F(Formal Parameter) = %d
", *F);
}
int main(){
int A;
printf("Enter a numbers
");
scanf("%d", &A);
/* Calling function using call by reference */
getDoubleValue(&A);
/* Any change in the value of formal parameter(F)
will effect the value of actual parameter(A) */
printf("A(Actual Parameter) = %d
", A);
return 0;
}