Just started learning C from Cocoa developing guide and I was wondering how (if at all possible) I would return the result of a function with multiple variable types. For example, I have a simple math function that I made to practice what I am reading and I gave it multiple variable types:
#include <stdio.h>
float doMath (int variable1, float variable2, int variable3, float variable4);
main()
{
printf ("Math is fun!!\n");
float theMath = doMath (2, 3.66, 9009, 7.990);
printf ( "Result = %f\n", theMath );
}
float doMath (variable1, variable2, variable3, variable4)
{
return (variable1 * variable2) + (variable3 - variable4);
}
How would I utilize multiple variable types properly in a single function/equation? Also, I'm not sure the syntax of the return line is correct either...I sort of just took a stab at it.