delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/04/12/08:15:22

From: Robin Burrows <rburrows AT bigfoot DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: How many bits do the Data types need?
Date: Sun, 12 Apr 1998 13:02:04 +0100
Organization: Virgin Net Usenet Service
Lines: 29
Message-ID: <3530AD3C.4CA7@bigfoot.com>
References: <6gq967$e25$1 AT news DOT metronet DOT de>
Reply-To: rburrows AT bigfoot DOT com
NNTP-Posting-Host: 194.168.65.207
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Lennart Marien wrote:
> 
> Hi!
> I have a short question concerning the data types in
> DJGPP.I programmed in Pascal and ASM so far and
> I now have to translate some Data Types.
> What I like to know is:
> How many bits is
> 
> a char(guess 8)
> a short(guess 16)
> an int(guess 32)
> a long(no idea)
> 
> Thank you!

Try this:

#include <stdio.h>

int main (void)
{
	printf ("char\t%d\nshort\t%d\nint\t%d\nlong\t%d\nptr\t%d\n",
		sizeof (char), sizeof (short int), sizeof (int),
		sizeof (long int), sizeof (char *));
	return 0;
}

(didn't test it, but should work)

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019