Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • there is still the following error 'two or more data types in declaration of objectCount'
    – kifcaliph
    Commented Jul 16, 2011 at 22:16
  • I forgot to put this line int Tree::objectCount = 0; outside the class and I forgot to end the header class with semicolon thank you
    – kifcaliph
    Commented Jul 16, 2011 at 22:35
  • Why does this variable have to be declared outside of the class? I am trying to define and initialize a private variable, and I am getting this same error. How do I do this outside the class? Commented Feb 1, 2012 at 3:31
  • @DavidFaux Show what are you trying to do. Only static const integral data members can be initialized within a class.
    – Mahesh
    Commented Feb 1, 2012 at 3:55