fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class Named {
  5. public:
  6. int i_;
  7. int j;
  8. Named(int i) : i_(i+1), j(i_) {};
  9. };
  10.  
  11.  
  12. int main() {
  13. Named n(0);
  14. cout << "i_ " << n.i_ << endl;
  15. cout << "j " << n.j << endl;
  16. }
Success #stdin #stdout 0.01s 5284KB
stdin
Standard input is empty
stdout
i_ 1
j 1