I know this type of question has been asked a lot but none of the answers seem to help. I set an environment variable through setenv()
function call in Ubuntu Linux. However, the program doesn't seem use this environment variables. If I use getenv()
it gets the correct value but the output to the program is wrong. However, when I use export BLOCKSIZE=512
in the shell, the output to the program is correct. I am not spawning different processes from the program. Below is only a code snippet of what I am doing, it is not my whole program.
Is there any reason for this?