delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/21/03:57:45

Message-Id: <199801210854.KAA04181@ankara.duzen.com.tr>
Comments: Authenticated sender is <mitch AT ankara DOT duzen DOT com DOT tr>
From: "S. M. Halloran" <mitch AT duzen DOT com DOT tr>
Organization: User RFC 822- and 1123-Compliant
To: swarnerx3 AT acadia DOT net (Scott Warner), jordimln AT jet DOT es
Date: Wed, 21 Jan 1998 10:55:11 +0200
MIME-Version: 1.0
Subject: Re: Data types
CC: djgpp AT delorie DOT com
In-reply-to: <199801210107.UAA22018@p2.acadia.net>
References: <34C53551 DOT D297940B AT jet DOT es>

On 20 Jan 98, Scott Warner was found to have commented thusly:

> #include<stdio.h>
> 
> int main(void)
> {
>   int i;
>   char c;
>   float f;
> 
>   printf("Size of integer: %d\n", sizeof(i);
>   printf("Size of char: %d\n", sizeof(c);
>   printf("Size of float: %d\n", sizeof(f);
> 
>   return 0;
> }
> 
> (and so on) is the general idea.  I believe sizeof(int) is
> equivelant to sizeof(i) in the above.  WORD and DWORD (and the like)
> are most likely preprocessor macros that you can find if you look
> carefully through the header files.
> 

You believe right.  The program could be revised to lose the 
variables and not put so much of a workload on the stack :)


#include<stdio.h>

int main(void)
{
  printf("Size of integer: %d\n", sizeof(int);
  printf("Size of char: %d\n", sizeof(char);
  printf("Size of float: %d\n", sizeof(float);
  return (0);
}

Mitch Halloran
Research (Bio)chemist
Duzen Laboratories Group
Ankara   TURKEY
mitch AT duzen DOT com DOT tr

other job title:  Sequoia's (dob 12-20-95) daddy

- Raw text -


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