Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!samsung!uakari.primate.wisc.edu!caen!uwm.edu!ux1.cso.uiuc.edu!osiris.cso.uiuc.edu!gordon From: gordon@osiris.cso.uiuc.edu (John Gordon) Newsgroups: comp.lang.c Subject: Re: Trouble spot! Message-ID: <1991Apr12.012718.7707@ux1.cso.uiuc.edu> Date: 12 Apr 91 01:27:18 GMT References: <1991Apr11.201116.28143@lynx.CS.ORST.EDU> Sender: usenet@ux1.cso.uiuc.edu (News) Distribution: usa Organization: University of Illinois at Urbana Lines: 29 I noticed several things about the program: 1) When you are fscanf()'ing in the data, you need to put a & by the integer you were reading in. Scanf() and related functions ALWAYS require a & before the recieving variable when reading in a single int, float, or char. Not for an array, though. example: scanf("%d", &answer); 2) You are putting the data in the file with an fwrite(), but you are reading it in with scanf(). You really should do input and output the same way. I would suggest reading it in with an fread(). 3) Don't use a * with fclose. when you say FILE *fp; close that file with fclose(fp); and don't put a * in front of it. --- John Gordon Internet: gordon@osiris.cso.uiuc.edu #include gordon@cerl.cecer.army.mil #include