#ifndef _MYCCLASS_H_
#define _MYCCLASS_H_
#ifndef C_CLASS
#define C_CLASS struct
#endif
#ifndef C_STATIC
//#define C_STATIC(classname,x) namespace classname{ x;}
#define C_STATIC(classname,x)
#endif
C_CLASS CDriverObject{
C_CLASS CDriverObject* pDO;
void (*Read)(C_CLASS CDriverObject* pDO);
void (*ReadX)();
int a;
int b;
C_STATIC(CDriverObject,int staticMember)
};
#endif
#include <stdio.h>
#include "MyCClass.h"
#include <memory.h>
#include <malloc.h>
void MyRead(C_CLASS CDriverObject *pDo)
{
printf("CDriverObject::a=%d\n",pDo->a);
}
void MyReadX()
{
printf("CDriverObject Static Member:\n");
}
int main()
{
C_CLASS CDriverObject* pDo;
pDo=(C_CLASS CDriverObject *)malloc(sizeof(C_CLASS CDriverObject));
// ASSERT(pDo);
memset(pDo,0,sizeof(C_CLASS CDriverObject));
pDo->Read=MyRead;
pDo->ReadX=MyReadX;
pDo->pDO=pDo;
pDo->Read(pDo);
pDo->ReadX();
free(pDo);
return 0;
}