fork download
  1. #include <iostream>
  2. #include <type_traits>
  3.  
  4. using namespace std;
  5.  
  6. typedef int pyat_intov[5];
  7. typedef pyat_intov* ukazatel_na_pyat_intov;
  8.  
  9. int main()
  10. {
  11. cout << "sizeof(pyat_intov) is "
  12. << sizeof(pyat_intov) << endl;
  13. ukazatel_na_pyat_intov kakaya_to_peremennaya = new pyat_intov[4];
  14.  
  15. cout << "pyat_intov& and *kakaya_to_peremennaya is "
  16. << std::is_same<pyat_intov&, decltype(*kakaya_to_peremennaya)>::value << endl;
  17. cout << "pyat_intov& and int* is "
  18. << std::is_same<pyat_intov&, int*>::value << endl;
  19.  
  20. auto x = *kakaya_to_peremennaya;
  21.  
  22. cout << "int* and x is "
  23. << std::is_same<int*, decltype(x)>::value << endl;
  24.  
  25. return 0;
  26. };
Success #stdin #stdout 0s 3228KB
stdin
Standard input is empty
stdout
sizeof(pyat_intov) is 20
pyat_intov& and *kakaya_to_peremennaya is 1
pyat_intov& and int* is 0
int* and x is 1