I am working on code where I have declared global variables at the top of the c code. Then in the main function I use random to set random values to these variables. Then the code calls upon an external function to do math on these values. However in this function all the variables appear as zero. is there a way to pass these variables?
Pseudo Code(but how code is set up)
// Header
int A, B;
main() {
A = (rand() % 14000);
B = (rand() % 14000);
// other things
math_func Printf("%d %d", A, B);
Return
}
math_func() {
A + B;
A* B;
A / B;
}
as it stands now A and B seem to 0 in math_func... any thoughts are appreciated.