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 }
1void initarr(int arrgender[TOT_MALE][TOT_FEMALE])
2 {
3 for(int a =0; a < TOT_MALE;a++)
4 {
5 for(int b = 0; b < TOT_FEMALE;b++)
6 {
7 arrgender[a][b] = 0;
8 }
9 }