From: Robert Herrick Newsgroups: comp.os.msdos.djgpp Subject: gets() and scanf("%s", &crap) Date: Thu, 17 Jul 1997 11:34:54 -0400 Organization: The University of Georgia Lines: 16 Message-ID: <33CE3B9D.FA878F7A@sunchem.chem.uga.edu> NNTP-Posting-Host: stickney2.chem.uga.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk What would be a good way of getting string and character I/O to work on MS-DOS machines? I've been writing C programs that I can compile under UNIX and run just fine with character and string I/O, but in MS-DOS, when I compile and run, the gets(), scanf("%c", &character) and scanf("%s", &string) get missed. I have fflushed stdin before each call to the input, but they still aren't performed. What is strange is that getchar() seems to work just fine. Is this a problem with the code or is there a quick patch that I can put on DJGPP to fix it so that it runs like it does under UNIX? What is the fundamental difference in the way that those two systems read characters that makes it run under UNIX but not MS-DOS? Could it be that I am running it in a DOS window on Win95? Thanks, Robert Herrick