Hi, Make the size of CodCred 101, ascCod 101 and ascCred 401 chars long. This m= akes = space for the terminating 0 that fscanf puts there and where you do = CodCred[100][1]=3D0; This is actually the 101st element in the array since = it is = 0 indexed. It is also a good idea to make sure that fscanf cant put more than 100+1 an= d = 400+1 characters in the char arrays. Perhaps use fread istead of fscanf to = limit the number of characters. /Ruben > Hi all, > I did a program, which reads a file and loads numbers into a 100 x 2 arra= y. I've > used dev-c++. > = > Then I went to another computer with VC++ 6.0, and the variables in the m= ain > 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. > = > = > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D Ruben J=F6nsson AB Liros Electronic Box 9124, 200 39 Malm=F6, Sweden TEL INT +46 40142078 FAX INT +46 40947388 ruben@pp.sbbs.se =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist