Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!purdue!mentor.cc.purdue.edu!jeo From: jeo@mentor.cc.purdue.edu (Richard Napier) Newsgroups: comp.sys.amiga Subject: Lattice C Message-ID: <6035@mentor.cc.purdue.edu> Date: 19 Dec 89 04:51:37 GMT Organization: Purdue University Lines: 29 I need help with a problem I have run into with Lattice C for the Amiga. I purchased the compiler in July and I am having trouble with the scanf() function. Here is my code. #include main() { int num1; char chr1; printf("Enter a number: "); scanf("%d",&num1); printf("\nEnter a character : "); scanf("\n%c",&chr1); printf("\n>> %c <<"); } According to a C book I have the \n before the %c in the scanf() should make the scanf ignore the \n that the previous scanf leaves behind. I tried this onthe UNIX system at Purdue University, and it worked fine. I then tried it on the Amiga, compiled it with Lattice C, and it doesn't work. The \n before the %c in the second scanf command is ignored. How can I get around this, someone told me that it had something to do with the keyboard buffer. Can I do something else that will work the same??? Can someone from Lattice help?? Thank You, Tony Hutson