1#include <iostream>
2using std::cout;
3
4int a[] = { 1, 2, 3, 4, 5 };
5int counta()
6 {
7 return sizeof( a ) / sizeof( a[ 0 ] ); // works, since a[] is an array
8 }
9
10int countb( int b[] )
11 {
12 return sizeof( b ) / sizeof( b[ 0 ] ); // fails, since b[] is a pointer
13 }