From: Robert Hoehne Newsgroups: comp.os.msdos.djgpp Subject: Re: Strange Behaviour ... Date: Tue, 28 Jan 1997 17:02:21 +0100 Organization: TU Chemnitz-Zwickau Lines: 42 Message-ID: <32EE230D.5E2C@Mathematik.tu-chemnitz.de> References: <32EDEBC4 DOT 49E1 AT eagle DOT patra DOT hol DOT gr> NNTP-Posting-Host: daemon.hrz.tu-chemnitz.de 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 Panos Platon Tsapralis wrote: > > char buffer[2048] > .. > int main(void) > > { > .. > strcpy(buffer,"string1"); /* Works O.K. - RHIDE debugger shows > buffer="string1" ... */ > .. > strcpy(buffer,"string2"); /* Old content of 'buffer' vanishes - RHIDE > debugger shows buffer="" !!! */ > .. > return(...); > } > > e) Last but not least ( and certainly the craziest of all ! ) : when I > rearrange the code by moving the second 'strcpy' towards the beginning > of the program, everything works O.K. !!! I think here you should see, that the problem is somewhere between the first and the second strcpy. Probably you are doing some strange things which I cannot see, because there are only some dots (and no code). The best way to check out where the problem is, is to add the buffer variable to the "Watchwindow" (in RHIDE Ctrl+F7) and after the first strcpy single step (F7 in RHIDE) through your code until you see any change at the variable, where it shouldn't. Robert -- ***************************************************************** * Robert Hoehne, Fakultaet fuer Mathematik, TU-Chemnitz-Zwickau * * Post: Am Berg 3, D-09573 Dittmannsdorf * * e-Mail: Robert DOT Hoehne AT Mathematik DOT TU-Chemnitz DOT DE * * WWW: http://www.tu-chemnitz.de/~rho * *****************************************************************