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.

6
  • 1
    While I personally agree that this is probably the cleanest way to do it, the question is how can i initialize static const int member outside class ? and that one is not outside of the class. Maybe it is what the OP is looking for, but then the question is asked incorrectly by the OP.
    – t.niese
    Commented Nov 25, 2020 at 14:12
  • @t.niese please read carefully. I want to initialaize members out of class. Can i do it?? Commented Nov 25, 2020 at 14:51
  • @user12918858 I didn't say anything else in my comment?
    – t.niese
    Commented Nov 25, 2020 at 14:57
  • @user12918858 to me it is a xyproblem.info: you're asking about how to handle a case that is already solved in modern C++: no need to discuss initialization outside the class if it can (and should) be done where it's declared (so inside, with inline).
    – Quarra
    Commented Nov 25, 2020 at 17:39
  • @Quarra and how to initialize from main? Commented Nov 25, 2020 at 17:42