Let me ask my question by this test program:
#include <iostream>
void testSizeOf(char* buf, int expected) {
std::cout << "buf sizeof " << sizeof(buf) << " expected " << expected << std::endl;
}
int main ()
{
char buf[80];
testSizeOf(buf, sizeof(buf));
return 0;
}
Output:
buf sizeof 8 expected 80
Why do I receve 8
instead of 80
?
upd just found similar question When a function has a specific-size array parameter, why is it replaced with a pointer?