Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!utcsri!flaps From: flaps@utcsri.UUCP Newsgroups: comp.lang.c Subject: Re: Portability of C Message-ID: <4607@utcsri.UUCP> Date: Fri, 17-Apr-87 00:21:30 EST Article-I.D.: utcsri.4607 Posted: Fri Apr 17 00:21:30 1987 Date-Received: Sat, 18-Apr-87 00:08:25 EST References: <213@pyuxe.UUCP> <710@brl-sem.ARPA> <422@ivax.doc.ic.ac.uk> Reply-To: flaps@utcsri.UUCP (Alan J Rosenthal) Organization: University of Toronto Lines: 28 Keywords: portability, short, data types Summary: In article <422@ivax.doc.ic.ac.uk> dcw@doc.ic.ac.uk (Duncan C White) writes: >So, what earthly USE is the current definition of 'short', 'int' and 'long' ? >Are there cases (the simpler the better :-) when the existing method is >useful ? ya, how about int i; for(i = 0; i < 10; i++) :-)s aside, the point is, if you want to count from 1 to 10 you don't care too much about the size of the integer (so long as it's not 3 bits or shorter, I suppose), but it would be stupid to use a 16-bit integer on a 32-bit machine or vice versa. 'int' is how you say "I don't care exactly how big this is." Good style in C involves using this approach as much as possible! Just like not specifying evaluation order, actually. -- Alan J Rosenthal flaps@csri.toronto.edu, {seismo!utai or utzoo}!utcsri!flaps, flaps@toronto on csnet, flaps at utorgpu on bitnet. "Probably the best operating system in the world is the [operating system] made for the PDP-11 by Bell Laboratories." - Ted Nelson, October 1977