Mail Archives: djgpp/1998/01/21/03:57:45
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 -