extern用法相关
文件A:
/* A.h */
#ifndef _A_CPP
#define _A_CPP
#include "B.h"
extern Test t;
#endif
/* A.cpp */
int main()
{
...
t.set(path);
...
}
/* B.h */
class Test
{
public:
TTT(..);
set(std::string path)
{this->path = path};
private:
std::string path;
} t;
/* B.cpp */
{
TTT(..)
{...}
}