Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Defining global variables in MS VC++

Options
  • 29-04-2007 3:04am
    #1
    Closed Accounts Posts: 2,349 ✭✭✭


    My project's getting too big so I'm splitting it.

    I have a class that's used by a few functions in the main file so it's defined globally (outside the functions), but when I move this code to another file I can't access that class any more.

    Is there a way to make this a truly Global variable, across all files?


Comments

  • Registered Users Posts: 1,481 ✭✭✭satchmo


    Have a read up on the extern keyword, that's for doing what you want.


  • Closed Accounts Posts: 2,349 ✭✭✭nobodythere


    Cheers, figured it out soon after posting from old source code. Who woulda thunk that I already knew it!


Advertisement