/****Lession1.h****/ extern bool a; extern int b; extern float c; extern double d; extern unsigned int e; extern long f; extern unsigned long g; extern char h; extern long double i; /****Lession1.cpp****/ #include "stdafx.h" #include "Lession1.h" bool a; int b; float c; double d; unsigned int e; long f; unsigned long g; char h; long double i; /****Test.cpp****/ #include "stdafx.h" #include#include "Lession1.h" using namespace std; int _tmain(int argc, _TCHAR* argv[]) { int b=2; ::a = true; ::b = 1; ::c = float(); ::d = double(); ::e = unsigned int(); ::f = long(); ::g = unsigned long(); ::h = char(); ::i = long double(); cout<<"全局变量 b="<<::b<