Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 May 1997 16:25:26 -0500 (CDT)
From:      Alec Kloss <alec@d2si.com>
To:        shovey@buffnet.net (Stephen Hovey)
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: How big is an int?
Message-ID:  <199705232125.QAA07420@d2si.com>
In-Reply-To: <Pine.BSI.3.95.970523164226.7479A-100000@buffnet7.buffnet.net> from Stephen Hovey at "May 23, 97 04:43:00 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
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 <stdlib.h>
#include <stdio.h>
#include <limits.h>

void main (void) {
    printf (Sizeof (int): %d\nINT_MAX: %d\n", sizeof (int), INT_MAX);
    exit (0);
  }





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199705232125.QAA07420>