fork(12) download
  1. #include <iostream>
  2.  
  3. void func(int array[5])
  4. {
  5. std::cout << "in func, array size is " << sizeof(array) << "\n";
  6. for (size_t i = 0; i < 5; ++i) {
  7. std::cout << array[i] << std::endl;
  8. }
  9. }
  10.  
  11. int main() {
  12. int mainArray[5] = { 10, 9, 8, 7, 6 };
  13. std::cout << "in main, array size is " << sizeof(mainArray) << "\n";
  14. func(mainArray);
  15.  
  16. return 0;
  17. }
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
in main, array size is 20
in func, array size is 4
10
9
8
7
6