These two lines are very dangerous... fscanf(pf,"%s",&ascCred); fscanf(pf,"%s",&ascCod); //load into a string variable A buffer overflow will trash Cod[] and *pf Don't use scanf() if you want stable and secure code. At 07:19 AM 11/13/2006, you wrote: >Hi all, >I did a program, which reads a file and loads numbers into a 100 x 2 array. >I've used dev-c++. > >Then I went to another computer with VC++ 6.0, and the variables in the main >appeared to be corrupted. >The array is a global variable. >I've found that changing the position of FILE *pf stops the function to >destroy all main variables contents. >In dev c++ never happens. > >FILE *pf has to be the first declaration in a function? > >Since so many firewalls are stripping out zip files, I have sent the code >as corrupt.zix. Save this file to disk and rename it corrupt.zip >The code to test is inside. > >Thank you in advance. >Dennis. > > > > >-- >http://www.piclist.com PIC/SX FAQ & list archive >View/change your membership options at >http://mailman.mit.edu/mailman/listinfo/piclist -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist