Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site watdcsu.UUCP Path: utzoo!watmath!watnot!watdcsu!broehl From: broehl@watdcsu.UUCP (Bernie Roehl) Newsgroups: net.lang.c,net.micro,net.micro.pc Subject: Re: weird C behavior Message-ID: <2194@watdcsu.UUCP> Date: Tue, 25-Mar-86 13:47:21 EST Article-I.D.: watdcsu.2194 Posted: Tue Mar 25 13:47:21 1986 Date-Received: Wed, 26-Mar-86 03:11:22 EST References: <557@utastro.UUCP> <436@umcp-cs.UUCP> Reply-To: broehl@watdcsu.UUCP (Bernie Roehl) Organization: U of Waterloo, Ontario Lines: 17 Keywords: strange, opaque, odd Xref: watmath net.lang.c:8255 net.micro:14112 net.micro.pc:7523 In article <436@umcp-cs.UUCP> chris@umcp-cs.UUCP (Chris Torek) writes: > >The code contains the following [paraphrased]: > > printf("%d\n", 36864); > >On a 16 bit machine, this should read > > printf("%ld\n", 36864); > Both are wrong on a 16 bit machine, and both will produce garbage (though probably different garbage). What you want is printf("%ld\n", 36864L); Note the 'L' suffix; this is how you tell C that you mean a Long constant.