fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void test(const int* notarr) {
  5. cout << sizeof(notarr) << endl;
  6. cout << sizeof(notarr)/sizeof(int) << endl;
  7. }
  8.  
  9. int main() {
  10. int* a = new int[10];
  11. cout << sizeof(a) << endl;
  12. test(a);
  13. delete a;
  14. return 0;
  15. }
Success #stdin #stdout 0s 16048KB
stdin
Standard input is empty
stdout
8
8
2