This is version . It is not the current version, and thus it cannot be edited.
Back to current version   Restore this version

C Data Type Sizes#

Done on current systems in 2015.#

MSOFT 32MSOFT 64MSOFT 64 CygwinLinux 32Linux 64Mac OS/X
char111111
short222222
int444444
long448488
long long888888
float444444
double888888
char*488488

Program Used#

#include <stdio.h>

#define PS(x)	printf("sizeof(" #x ") = %d\n", (int)sizeof(x))

main()
{
	PS(char);
	PS(short);
	PS(int);
	PS(long);
	PS(long long);
	PS(float);
	PS(double);
	PS(char *);
	return 0;
}

int to pointer code#

/*  _M_X64 = predefined macro for 64 bit Microsoft C  */

/* an int that is the same size as a pointer */
#ifndef INT_PTR
#ifndef INT_PTR
#ifdef _M_X64
typedef long long INT_PTR;
#else
typedef long INT_PTR;
#endif
#endif

Add new attachment

Only authorized users are allowed to upload new attachments.
« This particular version was published on 14-Apr-2016 15:23 by BlakeMcBride.