root/trunk/src/tutorials/examples/in_tutorial/size_sizeof/size.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 /* This used to work, but .size was renamed to .sizeof */
2
3 int main()
4 {
5     // Show information about integer types...
6     printf("bit\tmin: %d\tmax: %d (%u)\n", bit.min, bit.max, bit.size); 
7     printf("ubyte\tmin: %u\tmax: %u (%u)\n", ubyte.min, ubyte.max, ubyte.size); 
8     printf("ushort\tmin: %u\tmax: %u (%u)\n", ushort.min, ushort.max, ushort.size); 
9     printf("uint\tmin: %u\tmax: %u (%u)\n", uint.min, uint.max, uint.size); 
10     printf("ulong\tmin: %llu\tmax: %llu (%u)\n", ulong.min, ulong.max, ulong.size);   
11     printf("byte\tmin: %d\tmax: %d (%u)\n", byte.min, byte.max, byte.size); 
12     printf("short\tmin: %d\tmax: %d (%u)\n", short.min, short.max, short.size);   
13     printf("int\tmin: %d\tmax: %d (%u)\n", int.min, int.max, int.size);   
14     printf("long\tmin: %lld\tmax: %lld (%u)\n", long.min, long.max, long.size);   
15
16     // Show information about floating-point types...
17     printf("float (%u)\tdouble (%u)\treal (%u)\t", float.size, double.size, real.size);
18     printf("ifloat (%u)\tidouble (%u)\tireal (%u)\t", ifloat.size, idouble.size, ireal.size);
19     printf("cfloat (%u)\tcdouble (%u)\tcreal (%u)\t", cfloat.size, cdouble.size, creal.size);
20     printf("cfloat (%u)\tcdouble (%u)\tcreal (%u)\t", cfloat.size, cdouble.size, creal.size);
21
22     // Show information about character types...
23     printf("char (%u)\twchar (%u)\tdchar (%u)\t", char.size, wchar.size, dchar.size);
24
25     return 0;
26 }
Note: See TracBrowser for help on using the browser.