Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!gatech!hao!ames!oliveb!pyramid!batcomputer!braner From: braner@batcomputer.tn.cornell.edu (braner) Newsgroups: comp.sys.atari.st Subject: Re: passing shorts and longs (was: Mark Williams C) Message-ID: <926@batcomputer.tn.cornell.edu> Date: Fri, 8-May-87 17:06:44 EDT Article-I.D.: batcompu.926 Posted: Fri May 8 17:06:44 1987 Date-Received: Sat, 9-May-87 21:54:27 EDT References: <136@xrxns.UUCP> <9605@duke.cs.duke.edu> <2608@cit-vax.Caltech.Edu> Reply-To: braner@tcgould.tn.cornell.edu.UUCP (braner) Organization: Cornell Theory Center, Cornell University, Ithaca NY Lines: 14 Summary: longs are different! [] K&R does _NOT_ promise that all ints are passed as 4 bytes. All they said was that char and short are passed as int, and that int is the "natural size" for the machine (16 bits for the 68000, in my view). Longs may be longer than ints. Under both MWC and Megamax, ints are 16 bits and longs are 32. BTW: in Megamax, if d is 'double', you have to use "scanf("%lf", &d)" (not "%f"). On the other hand, if f is 'float', you _can_ use "printf("%lf", f)"---as well as "printf("%f", d)"! That's because floats are passed as doubles, but pointers are just pointers so that scanf() cannot tell what it's got. - Moshe Braner