Environment Variables in C
Posted
by
tpar44
on Stack Overflow
See other posts from Stack Overflow
or by tpar44
Published on 2012-09-24T01:13:27Z
Indexed on
2012/10/06
21:38 UTC
Read the original article
Hit count: 173
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?
© Stack Overflow or respective owner