Path: utzoo!attcan!uunet!ncrlnk!ncrcae!hubcap!gatech!udel!rochester!rutgers!att!ulysses!andante!alice!debra From: debra@alice.UUCP (Paul De Bra) Newsgroups: comp.unix.wizards Subject: Re: Unix problem or C problem? Message-ID: <8789@alice.UUCP> Date: 18 Jan 89 19:49:46 GMT References: <245@ibd.BRL.MIL> Reply-To: debra@alice.UUCP () Organization: AT&T, Bell Labs Lines: 25 In article <245@ibd.BRL.MIL> heilpern@brl.arpa (Mark A. Heilpern (IBD) ) writes: >... > while (fscanf(input,"%d",stars)!=EOF) { >... > for (count = 0; count <= stars; count++) >... > I get the following error message, NOT put out from my program: > >PROTECTION VIOLATION: name='plot', pid=15943, pc=a410cdc, ps=80000180 >Illegal instruction From your piece of code it looks like "stars" is either an int, in which the fscanf line should have &stars, or else it is a pointer to an int, in which case the for-line should have *stars. From the protection violation i deduce it is probably the first. The error message seems strange though. I would expect a simple Illegal instruction, core dumped or Memory Fault, core dumped messge. You actually get a lot of info there. Paul. -- ------------------------------------------------------ |debra@research.att.com | uunet!research!debra | ------------------------------------------------------