To be clear, you want to read the values of buttons (meaning unspecified) and use those values to set a float and an int variable. Further, you want to write a function that takes a couple of parameters that specify where you want to store those button values?
That is an unusual way to use function parameters. Usually function parameters specify an input value, and then you use that value to do something. Instead, you want to have the inputs be globally available readings (button values) and have the function parameters specify where to store those values.
C and C++ function parameters are usually passed "by value". That means that what gets sent to the function is a value, not a pointer to the variable that contains that variable. Thus the called function can't change the original variable.
If you want to pass a pointer to the variable, you have to use the &
"address of" operator to pass the variable "by reference".
Your function might look like this using C++ pass by reference syntax:
void SetTFgr(float &T, int &FGr) {
float input_T = //figure out button value for T
T = input_T;
int input_FGr = //figure out button value for Far
FGr = input_FGr;
}
Then you'd invoke it like this:
SeTFgr(T, FGr);
You could also accomplish the same thing using C pointer syntax.