Path: utzoo!attcan!uunet!lll-winken!ncis.llnl.gov!ncis!helios.ee.lbl.gov!pasteur!ucbvax!decwrl!purdue!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn ) Newsgroups: comp.unix.wizards Subject: Re: Unix problem or C problem? Message-ID: <9417@smoke.BRL.MIL> Date: 18 Jan 89 01:14:32 GMT References: <245@ibd.BRL.MIL> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 11 In article <245@ibd.BRL.MIL> heilpern@brl.arpa (Mark A. Heilpern (IBD) ) writes: > while (fscanf(input,"%d",stars)!=EOF) { > fprintf(stderr,"OK to this point.\n"); >PROTECTION VIOLATION: name='plot', pid=15943, pc=a410cdc, ps=80000180 > The "OK to this point" message does not appear when put > in this position, however it does when placed one line above. Ahem. Doesn't that TELL you something? Like perhaps there is a problem with the "while (fscanf(input,"%d",stars)!=EOF)"? In fact your problem is almost certainly that "stars" is not a pointer to an integer as required by fscanf(). Perhaps you meant "&stars".