c initialise array of dynamic size to 0 code example
Example 1: 1d fixed length arrays c++
void initarr(int arrgender[TOT_MALE][TOT_FEMALE])
{
for(int a =0; a < TOT_MALE;a++)
{
for(int b = 0; b < TOT_FEMALE;b++)
{
arrgender[a][b] = 0;
}
}
Example 2: c++ allocate dynamic with initial values
int length = 50;
int *array = new int[length]();
// returns 50 length array of 0