delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/06/05/02:30:24

From: Radical NetSurfer <radsmail AT juno DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Size_Of in DJGPP...Bug?
Date: Mon, 05 Jun 2000 02:14:40 -0400
Message-ID: <u9hmjs4dknggq2jboelfo8o4pv0b0op60h@4ax.com>
X-Newsreader: Forte Agent 1.7/32.534
MIME-Version: 1.0
NNTP-Posting-Host: 216.202.134.212
X-Original-NNTP-Posting-Host: 216.202.134.212
X-Trace: 5 Jun 2000 02:15:42 -0400, 216.202.134.212
Lines: 48
X-Original-NNTP-Posting-Host: 64.31.79.51
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Try this:

/* VS.C/EXE
   A program to list the Size of Various Data Types
   utilized by the DJGPP C/C++ compiler.

   This program can be used by other compilers to
   compare their data-sizes for 32 vs. 16 bit modes.

   June 5th, 2000  1:30am
*/

#include <stdio.h>
#include <stdlib.h>

void main(void) {

   printf("The size_of a Char   is %ld\n", sizeof(char));
   printf("The size_of a Short  is %ld\n", sizeof(short));
   printf("The size_of a Int    is %ld\n", sizeof(int));
   printf("The size_of a Long   is %ld\n", sizeof(long));
   printf("The size_of a Float  is %ld\n", sizeof(float));
   printf("The size_of a Double is %ld\n", sizeof(double));
   printf("The size_of a Long Double is %ld\n", sizeof(long double));
// printf("The size_of a Enum   is %ld\n", sizeof(enum));

} //Main
/*
Output:
The size_of a Char   is 1
The size_of a Short  is 2
The size_of a Int    is 4
The size_of a Long   is 4
The size_of a Float  is 4
The size_of a Double is 8
The size_of a Long Double is 12
*/


QUESTION:
Why is not proper to use 'enum' in Size_of ??
Normally, this is defined as 2-Bytes (=to short or int),
but in DJGPP, its a SYNTAX error....

THANKS!
//the Radical NetSurfer Kind of Guy//
http://members.tripod.com/~RadSurfer/

- Raw text -


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