Program code: #include <iostream> struct Test { unsigned count; Test(): count() { } Test(const Test &x): count(x.count+1) { } }; int main() { Test obj0, obj1=Test(), obj2=Test(Test()); std::cout << obj0.count << '\n'; std::cout << obj1.count << '\n'; std::cout << obj2.count << '\n'; return 0; } Expected result: 0 1 2 Actual result: 0 0 0
Attachment:
signature.asc
Description: This is a digitally signed message part.