I
iC and iC++
I have the following code snippet from my program that i am working on
int running = 0;
float var1, average_value;
void is_process_running(void) {
if (fabs(var1 - average_value) <= 0.001)
{
*(&running) = 0;
}
else
*(&running) = 1;
}
var1 and average value get their value from somewhere else.
is it possible to change the value of "is_running" by referencing to
it with a pointer to its address i.e. <return *(&running)> with out
passing it as an argument to the function or making it the return
value of the function.
Thanks,
int running = 0;
float var1, average_value;
void is_process_running(void) {
if (fabs(var1 - average_value) <= 0.001)
{
*(&running) = 0;
}
else
*(&running) = 1;
}
var1 and average value get their value from somewhere else.
is it possible to change the value of "is_running" by referencing to
it with a pointer to its address i.e. <return *(&running)> with out
passing it as an argument to the function or making it the return
value of the function.
Thanks,