Quantcast
Channel: CodeGuru Forums - Visual C++ Programming
Viewing all articles
Browse latest Browse all 3029

C++ extern question

$
0
0
MFC application.
I created a file access class for simple debug stuff that's not needed to run thru the document's serialize. I want to be able to call it from anywhere or any class, so I figured I can just put it global in the app's header file right under the theApp object. I used VC 6 in the past and I don't remember seeing the extern in front of the theApp object. Now I'm using VC 2005 and the project created the app object with extern.

I assume I should create my class object with extern also ?
What is the difference in a global object with or without extern ?

----In my app's header file--
extern CViewSwitchApp theApp;
extern MyFileClass FileClass;
----------------------------

Viewing all articles
Browse latest Browse all 3029

Latest Images

Trending Articles



Latest Images