fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class A{
  5. public:
  6. int value;
  7. };
  8.  
  9. int main(){
  10. A x;
  11. x.value = 1;
  12. A* ptrx = &x;
  13. A** pptrx = &ptrx;
  14. std::cout << x.value << std::endl;
  15. std::cout << ptrx->value << std::endl;
  16. std::cout << (*ptrx).value << std::endl;
  17. std::cout << (*pptrx)->value << std::endl;
  18. }
  19.  
  20. //https://pt.stackoverflow.com/q/497977/101
Success #stdin #stdout 0s 4708KB
stdin
Standard input is empty
stdout
1
1
1
1