From: Weiqi Gao Newsgroups: comp.os.msdos.djgpp Subject: Re: Remaining enviroment.. Date: Tue, 16 Dec 1997 22:40:32 -0600 Organization: Spectrum Healthcare Services Lines: 20 Message-ID: <349757C0.6A8D786F@a.crl.com> References: <6739kc$f1$1 AT usenet DOT kreonet DOT re DOT kr> NNTP-Posting-Host: a116001.stl1.as.crl.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk DongJun Kim wrote: > > I want to remain my enviroment if my program terminated or not. > I used putenv( "MYPROG=C:/LANG/MYPROG.CFG" ) in my program. > > But after terminated, it is not in enviroment variables. > ( I checked it by typing "SET" ) > > What have to I do now? Every program inherits a private copy of the environment from the master environment when it starts. putenv() modifies that private copy of the environment only. When your program terminates, that private copy of the environment is gone with it, along with it your modifications. To modify the master environment, you need to find it. -- Weiqi Gao weiqigao AT a DOT crl DOT com