root/trunk/src/tutorials/examples/in_tutorial/size_sizeof/sizeof.d

Revision 6, 1.4 kB (checked in by jcc7, 3 years ago)

Made more progress in developing convertToWiki and added some files.

Line 
1 int main()
2 {
3     // Show information about integer types...
4     printf("bit\tmin: %d\tmax: %d (%u)\n", bit.min, bit.max, bit.sizeof); 
5     printf("ubyte\tmin: %u\tmax: %u (%u)\n", ubyte.min, ubyte.max, ubyte.sizeof); 
6     printf("ushort\tmin: %u\tmax: %u (%u)\n", ushort.min, ushort.max, ushort.sizeof); 
7     printf("uint\tmin: %u\tmax: %u (%u)\n", uint.min, uint.max, uint.sizeof); 
8     printf("ulong\tmin: %llu\tmax: %llu (%u)\n", ulong.min, ulong.max, ulong.sizeof);   
9     printf("byte\tmin: %d\tmax: %d (%u)\n", byte.min, byte.max, byte.sizeof); 
10     printf("short\tmin: %d\tmax: %d (%u)\n", short.min, short.max, short.sizeof);   
11     printf("int\tmin: %d\tmax: %d (%u)\n", int.min, int.max, int.sizeof);   
12     printf("long\tmin: %lld\tmax: %lld (%u)\n", long.min, long.max, long.sizeof);   
13
14     // Show information about floating-point types...
15     printf("float (%u)\tdouble (%u)\treal (%u)\t", float.sizeof, double.sizeof, real.sizeof);
16     printf("ifloat (%u)\tidouble (%u)\tireal (%u)\t", ifloat.sizeof, idouble.sizeof, ireal.sizeof);
17     printf("cfloat (%u)\tcdouble (%u)\tcreal (%u)\t", cfloat.sizeof, cdouble.sizeof, creal.sizeof);
18     printf("cfloat (%u)\tcdouble (%u)\tcreal (%u)\t", cfloat.sizeof, cdouble.sizeof, creal.sizeof);
19
20     // Show information about character types...
21     printf("char (%u)\twchar (%u)\tdchar (%u)\t", char.sizeof, wchar.sizeof, dchar.sizeof);
22
23     return 0;
24 }
Note: See TracBrowser for help on using the browser.