# include /*-------------------------------------- Check size of types Ver.2.30 NIHIRA Takuma(soft@nihira.jp) 2001.4.15 Ver.1.00 first release 2001.4.16 Ver.2.00 revised for CGI 2001.4.17 Ver.2.01 trivial revise 2001.4.20 Ver.2.10 add pointer type 2001.6.25 Ver.2.20 add float type 2001.6.25 Ver.2.30 optimized --------------------------------------*/ int main(void) { int c,c8; int s,s8; int i,i8; int l,l8; int f,f8; int d,d8; int ld,ld8; int p, p8, *pp; c = sizeof(char); c8 = c * 8; s = sizeof(short); s8 = s * 8; i = sizeof(int); i8 = i * 8; l = sizeof(long); l8 = l * 8; f = sizeof(float); f8 = f * 8; d = sizeof(double); d8 = d * 8; ld = sizeof(long double); ld8 = ld * 8; p = sizeof(pp); p8 = p * 8; printf("Content-type: text/html; charset=iso-8859-1\n\n"); printf("\n"); printf("\n"); printf("\n"); printf("The size of C types on this machine\n"); printf("\n"); printf("\n"); printf("\n"); printf("\n"); printf("

The size of C types on this machine

\n"); printf("\n"); printf("\n"); printf(""); printf("\n", c, c8); printf(""); printf("\n", s, s8); printf(""); printf("\n", i, i8); printf(""); printf("\n", l, l8); printf(""); printf("\n", f, f8); printf(""); printf("\n", d, d8); printf(""); printf("\n", ld, ld8); printf("\n"); printf(""); printf("\n", p, p8); printf("
typesize(bytes)size(bits)
char, signed char, unsigned char%d%d
short, unsigned short%d%d
int, unsigned int%d%d
long, unsigned long%d%d
float%d%d
double%d%d
long double%d%d
pointer%d%d
\n"); printf("

This machine should be %d bit machine.

\n", i8); printf("
\n"); printf("

"); printf("This cgi made by NIHIRA Takuma"); printf("

\n"); printf("Back\n"); printf("

\n"); printf("\n"); printf("\n"); return 0; }