int f( int i ) {
printf("called f\n");
if (i < 0) return -i;
else
return 3 * i;
}
I just want to know what int "f" means.
int f( int i ) {
printf("called f\n");
if (i < 0) return -i;
else
return 3 * i;
}
I just want to know what int "f" means.
Basically, int f(int i)
means :
It is just the name of the function that was declared. In this case it is a function that returns an integer. We could declare the same one with a different name:
int name() {
return (1 + 2);
}
The function that you provided is most likely used in the main()
function, like this:
int main(){
int x = 2;
int output = f( x );
printf("%d", output);
return 0;
}