------------1.h-------------------
int a;
class test1
{
public:
test1(){a=5;}
};
-------------1.cpp--------------------
#include "1.h"
-------------2.h-----------------------
#include "1.h"
extern int a;
-------------2.cpp--------------------
#include <iostream.h>
#include "2.h"
void main()
{
char d;
test1* newclass=new test1();
cout<<a;
cin>>d;
}