Hi
For example i have .h and .cpp file that define my class like that:
andCode://a.h class CExample { public: int a,b,c; CExample (int n, int m); void multiply() ; };
I want to use Cexample class object in another .cpp file without include a.h in the same projectCode://a.cpp #include "a.h" CExample::CExample (int n, int m) { a=n; b=m; }; void CExample::multiply () { c=a*b; };
Like that:
It gives error.Code://main.cpp #include "stdafx.h" int _tmain(int argc, _TCHAR* argv[]) { extern CExample c(5,4); //gives error. return 0; }
Is there a way to use an object in another .cpp file (in the same project) without include its header file in c++?
I tried extern CExample c(5,4);
but doesnt work
Thanks



LinkBack URL
About LinkBacks



