.h文件
extern 声明方法,变量
.cpp文件
定义方法,变量
例子:
a.h
extern int _num;
a.cpp
int _num = 0;
注意:
.h最好加上宏定义
#ifndef CC_A_H
#define CC_A_H
或者
#pragma once
.h文件
extern 声明方法,变量
.cpp文件
定义方法,变量
例子:
a.h
extern int _num;
a.cpp
int _num = 0;
注意:
.h最好加上宏定义
#ifndef CC_A_H
#define CC_A_H
或者
#pragma once