another question:
knowing that program is a pointer.
should i do this? or it will exit my program automaticaller?
if (!program){
return;
}
I have no idea.
Assuming "program" is a pointer object, the code fragment above will
execute the return statement if and only if the current value of
"program" is a null pointer. If the name "program" is intended to
mean something, you'll have to clarify what it is; "program" is just
an ordinary identifier with no special significance. The return
statement will exit the current function. It will exit your program
only if it appears within the body of main(). If it is within main(),
it should specify a value, since main is declared to return int; the
only portable values are 0, EXIT_SUCCESS, and EXIT_FAILURE.
Without knowing the context or what you're trying to accomplish, we
have no way of guessing what you should do.