From: Fernando Newsgroups: comp.os.msdos.djgpp Subject: Re: why won't my .exe program run properly until I set env var? Date: Wed, 28 Jan 1998 16:06:14 -0500 Organization: My own Lines: 18 Message-ID: <34CF9DC6.70B63542@127.0.0.1> References: NNTP-Posting-Host: 147.54.84.90 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 The variable "n" does not have his own space. So you can't strcat anything to "n". > > main(int argc, char *argv[]) > > { > > char *d, *p, *n, *e; > > int dummy = fnsplit(argv[1], d, p, n, e); > > /* This splits a filename into drive, path, name and extension. */ > > > > dummy = rename("oldname.txt", strcat(n, ".txt")); > > } > -- These are my personal opinions. Email: sanabriaf at yahoo dot com