C++ header and class relationships

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • drsmooth
    New Member
    • Oct 2007
    • 112

    #1

    C++ header and class relationships

    i have this class, the 'Keep' :

    Code:
    #ifndef Keep_h
    #define Keep_h
    
    #include "Granery.h"
    class Keep
    {
     public:
      Keep();
      static Granery g;
      static Granery getGranery(){return g;};
      static void initialize();
    };
    #endif
    i now also have the granery object with a default constructor Granery();

    how would i go about initializing the granery variable g?

    if more code is needed to answer this let me know and ill post whatever needs to be looke at...


    thanks alot,
    ken
  • oler1s
    Recognized Expert Contributor
    • Aug 2007
    • 671

    #2
    http://www.cprogrammin g.com/tutorial/statickeyword.h tml

    Comment

    Working...