fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. class A{
  6. public:
  7. int n=0;
  8. A(int n):n(n){};
  9. };
  10.  
  11. int main(){
  12. A a(5);
  13. A b=a;
  14. a.n=10;
  15. cout<<b.n;
  16. return 0;
  17. };
Success #stdin #stdout 0s 3412KB
stdin
Standard input is empty
stdout
5