/* FILE valuesize.h
*/
#ifndef _VALUESIZE_H_
#define _VALUESIZE_H_
#ifdef __cplusplus
extern "C" {
#endif
int value_size(char *);
#ifdef __cplusplus
}
#endif
#endif
========================================
/* FILE valuesize.cpp
*/
#include
int value_size(char *value)
{
if ( !(strcmp ("size_t", value)) )
return sizeof(size_t);
return 0;
}
========================================
/* FILE main.cpp
*/
#include
#include "valuesize.h"
int main()
{
int a;
a = value_size("size_t");
printf("size_t 의 크기는 %d 입니다.\n", a);