Menu

global variables

2002-02-19
2012-09-26
  • Nobody/Anonymous

    hey
    could anyone explain how to declare global variables in c++??

     
    • Nobody/Anonymous

      Just delare it outside any function in the CPP file, of course, before the functions.
      If the same global is to be used in another Source File in the project, it should be declared again with the keyword  < extern >.
      Just try a very simple Message Box-based Application, with already initialized values, and then go further. I have succeeded it from the first attempt.
      In our days, of big applications, the use of global variables is more and more limited, however.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.