Use this little example:
#pragma once
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <tchar.h>
#pragma comment(lib,"user32.lib")
static int scase(const TCHAR* find,const TCHAR* list,TCHAR sep)
{
unsigned int is,il,done;
for(done=il=0;list[il];done++)
{
for(is=0;(find[is]==list[il])&&(0!=find[is]);is++,il++);
if((0==list[il]) || (sep==list[il]))
{
return 0==find[is]?done:-1;
if(list[il]) ++il;
}
else
{
for(++il;list[il]&&(sep!=list[il-1]);il++);
}
}
return -1;
}
size_t sizeof_typename(const TCHAR* typ)
{
switch(scase(typ,__TEXT("int|short|char|long|__int64|POINT|DWORD|RECT"),'|'))
{
case 0: return sizeof(int);
case 1: return sizeof(short);
case 2: return sizeof(char);
case 3: return sizeof(long);
case 4: return sizeof(__int64);
case 5: return sizeof(POINT);
case 6: return sizeof(DWORD);
case 7: return sizeof(RECT);
}
return 0;
}
int FAR PASCAL _tWinMain(HINSTANCE h,HINSTANCE p,LPTSTR c,int sw)
{
const TCHAR* type = __TEXT("__int64");
size_t size = sizeof_typename(type);
TCHAR msg[256];
_stprintf_s(msg,sizeof(msg)/sizeof(msg[0]),__TEXT("sizeof(%s) = %i"),type,size);
MessageBox(0,msg,__TEXT("sizeof_typename"),32);
return 0;
}