Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!wuarchive!uunet!mcsun!hp4nl!charon!guido From: guido@cwi.nl (Guido van Rossum) Newsgroups: comp.sys.mac.system Subject: Re: Think C and strncmp Message-ID: <3405@charon.cwi.nl> Date: 25 Apr 91 09:31:41 GMT References: <23554@unix.SRI.COM> Sender: news@cwi.nl Lines: 31 larson@snmp.sri.com (Alan Larson) writes: > Recently I have tried converting a program to use Think C version >4. I have discovered an interesting set of problems: > 1. Some routines from the old stdio package are gone, such > as kbhit(), apparently leaving no way to determine if > a key has been hit. > As it is desirable to be able interrupt a running program, > this is annoying. Button() doesn't work very well when > the program is doing a lot of output to the screen. If all you want is interrupting a program, you can use a signal handler. These are checked when the program prints any output to the console and when it waits for console input. Bonus: this is Unix compatible (if you are careful). > 3. The strncmp routine now wants a long (actually size_t) > as its third argument. This makes it especially difficult > to write programs that will port easily to and from unix > systems, where that variable is still an int. This would > be less of a problem if the compiler did the type conversion, > but it doesn't. If you #include , the compiler will do the conversions for you, based upon the prototype. --Guido van Rossum, CWI, Amsterdam Honary Member, Royal Society for Putting Things on Top of Other Things