#include <iostream>
void func(int array[5])
{
std::cout << "in func, array size is " << sizeof(array) << "\n";
for (size_t i = 0; i < 5; ++i) {
std::cout << array[i] << std::endl;
}
}
int main() {
int mainArray[5] = { 10, 9, 8, 7, 6 };
std::cout << "in main, array size is " << sizeof(mainArray) << "\n";
func(mainArray);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKdm9pZCBmdW5jKGludCBhcnJheVs1XSkKewoJc3RkOjpjb3V0IDw8ICJpbiBmdW5jLCBhcnJheSBzaXplIGlzICIgPDwgc2l6ZW9mKGFycmF5KSA8PCAiXG4iOwogICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCA1OyArK2kpIHsKICAgICAgICBzdGQ6OmNvdXQgPDwgYXJyYXlbaV0gPDwgc3RkOjplbmRsOwogICAgfQp9CgppbnQgbWFpbigpIHsKICAgIGludCBtYWluQXJyYXlbNV0gPSB7IDEwLCA5LCA4LCA3LCA2IH07CiAgICBzdGQ6OmNvdXQgPDwgImluIG1haW4sIGFycmF5IHNpemUgaXMgIiA8PCBzaXplb2YobWFpbkFycmF5KSA8PCAiXG4iOwogICAgZnVuYyhtYWluQXJyYXkpOwoKCXJldHVybiAwOwp9