Why the ISO C++ standard forbids the initialization for members? [closed]
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . Why i can't do that class A { public: int x = 10; ... }; and I have to do that ? class A { public: int x; A(){ x = 10; ... } ... }; It's because C++ is trying to be more type safe than languages like C ? There are other reasons ? This