home *** CD-ROM | disk | FTP | other *** search
- /*Program 3_8 - Output addresses and Size of a few variables
- by Stephen R. Davis
-
- Just as a demonstration of the different memory models, output
- a few addresses and pointer sizes.
- */
-
- #include <stdio.h>
-
- /*Main - output some sample variable sizes*/
- main ()
- {
- printf ("The sizes are as follows:\n"
- " character - %u bytes\n"
- " integer - %u bytes\n"
- " float - %u bytes\n"
- " double - %u bytes\n"
- "\n"
- " pointer - %u bytes\n"
- " far pointer - %u bytes\n"
- " near pointer- %u bytes\n"
- " proc - %u bytes\n",
- sizeof (char),
- sizeof (int),
- sizeof (float),
- sizeof (double),
- sizeof (int *),
- sizeof (int far *),
- sizeof (int near *),
- sizeof (main));
- }