[comp.lang.fortran] How to Read 1 char?

williamo@hpcupt1.HP.COM (William O'Saughnessy) (07/28/88)

How to Read 1 char?

I would like to know how to read 1 character from a fortran program
on unix without typing the carriage return after the character.
This is trivial in C, but I have a 1500 line Fortran program that
I am migrating to unix.  
			   Thanks for your help,
			   Bill O'Shaughnessy

jerry@violet.berkeley.edu ( Jerry Berkman ) (08/11/88)

In article <5980001@hpcupt1.HP.COM> williamo@hpcupt1.HP.COM (William O'Saughnessy) writes:
>I would like to know how to read 1 character from a fortran program
>on unix without typing the carriage return after the character.

Use the getc() routine for standard input, fgetc() for arbitrary units.
See "man 3f getc" for details.
	- Jerry Berkman, Computing Services, U.C.Berkeley
	  (415)642-4804, jerry@violet.berkeley.edu