1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#include <iostream> class A { public: int x; int y; A (int x, int y); }; A::A(int x, int y) { this->x = x; this->y =y; } int main() { A a = A(17, 42); std::cout << a.x << "\n"; std::cout << a.y << "\n"; }