C++宏问题
有文件zyl.h,内容如下:
#ifndef ZYL_H
#define ZYL_H
#include <iostream>
#define DEFINE_CLASS_X(class_name) \
char NameArray##class_name[]=#class_name;\
class class_name
DEFINE_CLASS_X(ZYL)
{
public:
void Display(){printf("ZYL\n");};
};
#endif
#include "zyl.h"
#include <cstdlib>
#include <iostream>
#include "zyl.h"
using namespace std;
int main(int argc, char *argv[])
{
ZYL* tmp = new ZYL;
system("PAUSE");
return EXIT_SUCCESS;
}