From owner-freebsd-questions Fri May 23 14:25:44 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id OAA17456 for questions-outgoing; Fri, 23 May 1997 14:25:44 -0700 (PDT) Received: from d2si.com (macbeth.d2si.com [206.8.31.2]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id OAA17451 for ; Fri, 23 May 1997 14:25:38 -0700 (PDT) Received: (from alec@localhost) by d2si.com (8.8.5/8.8.5) id QAA07420; Fri, 23 May 1997 16:25:26 -0500 (CDT) From: Alec Kloss Message-Id: <199705232125.QAA07420@d2si.com> Subject: Re: How big is an int? In-Reply-To: from Stephen Hovey at "May 23, 97 04:43:00 pm" To: shovey@buffnet.net (Stephen Hovey) Date: Fri, 23 May 1997 16:25:26 -0500 (CDT) Cc: freebsd-questions@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL31 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Stephen Hovey is responsible for: > > How big is type int on freebsd? 2 bytes? 4? Im trying to figure out > max/min vals and if I need to convert some software I have to longs. > > Thanx > Unless I'm very much mistaken, the size of an int is 32 bits--4 bytes. If you are looking to figure out what the largest int on a machine is, reference INT_MAX in a C program. For size of integers, use the sizeof operator. I believe the following C program will print out the information you are looking for: #include #include #include void main (void) { printf (Sizeof (int): %d\nINT_MAX: %d\n", sizeof (int), INT_MAX); exit (0); }