by using c++ how to set environment variables in unix

hi,

I am writing c++ code in unix operating system.In that i need to set the environment variable in unix.

suppose previously i have environment variable like path="something" now i need to change the path value to some othervalue . so that some other program will access that path value and by using new path value some new program will work.so please tell me the way for this.

After changing the environement variable i need to access that changed environment variable for some running another program.

Dont break the rules by bumping up your posts. Here is your original thread - how to set the environment variable at run time