Why can't I initialize my static member data in my constructor's init

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mahendra23
    New Member
    • Jun 2007
    • 13

    Why can't I initialize my static member data in my constructor's init

    can anybody tell me in detail.
  • dumparun
    New Member
    • Feb 2007
    • 26

    #2
    Originally posted by mahendra23
    can anybody tell me in detail.
    static member data has a global scope and will reside through out the entire life of the program.
    There is only one copy and will be initialized only once.
    A constructor is called everytime the class is instantiated, and the reason !!!!!

    Comment

    Working...