#include <iostream> class A { public: int a = 1; }; int main() { A a; std::cout << a.a << std::endl; return 0; } // Output: 1References: http://en.cppreference.com/w/cpp/language/data_members
https://isocpp.org/wiki/faq/cpp11-language-classes#member-init
No comments:
Post a Comment