Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!hplabs!hpda!hpcuhb!hpihoah!cring From: cring@hpihoah.cup.hp.com (Craig Ring) Newsgroups: comp.sys.mac.programmer Subject: Numbers from TEXT files under Think C ? Message-ID: <17150002@hpihoah.cup.hp.com> Date: 18 Apr 91 19:34:32 GMT Organization: Hewlett Packard, Cupertino Lines: 18 I am writing a program in Think C 4.0 that needs to read numeric input from an ASCII text file. Under UNIX this is very easy to do with fscanf() and so on. Is there a simple way to do this with a Macintosh? I would like to be able to use SFGetFile() to allow the user to pick the file they would like to open, but the SFReply doesn't seem to be very useful to the ANSI C libraries for Think C. The Think C documentation says that scanf() requires a pointer to type FILE, which I am not sure how to get. I could of course write my own routines to use the Toolbox calls to read data from the file, and then convert the ASCII character codes to a numeric data type, but this seems like a lot of work compared to using library routines to do it for me. Any help you can give me would be greatly appreciated. Craig Ring cring@leland.stanford.edu