I write three different type define but they executes same result. so why is this happening. I thought the result might be different because I used the same way to execute the function.
#include <stdio.h>
int* digit(int* number){
return number;
}
typedef int*function0(int*);
typedef int*(function1(int*));
typedef int*(*function_pointer)(int*);
void printDigit0(function0 p, int* digit){
printf("%d", *p(digit));
}
void printDigit1(function1 p, int* digit){
printf("%d", *p(digit));
}
void printDigit2(function_pointer p, int* digit){
printf("%d", *p(digit));
}
int main() {
int a = 10;
printDigit0(digit, &a);
printDigit1(digit, &a);
printDigit2(digit, &a);
return 0;
}
they all printed 10