I need to transform a local variable into a global variable so I can use it in one of my functions.
I thought about passing the value as a parameter to this function but I can do this since the function is called inside the while loop and this variable counts how many times the while loop does (so the final value is outside the loop).
Example to visualize better:
So, I need to transform the final value of "count" into a global variable. Can I do this?Code:while(condition) { function(parameter1, parameter2); count = count + 1; } printf("%d\n", count);