参考博客:http://bbs.csdn.net/topics/10439749
#include<iostream>
#include "test.h"
using namespace std;
int main()
{
test *p = test::createtest();
return 1;
}
#pragma once
class test
{
public:
test(void);
~test(void);
static test *test_t;
static test* createtest();
};
#include "test.h"
test* test::test_t;
test::test(void)
{
}
test::~test(void)
{
}
test* test::createtest()
{
test_t = new test();
return 0;
}
在类的定义文件的头部:必须加上LCD* LCD::lcd;