in test function the for loop work fine but printf(num[0])is getting 0. does any one know why?

int main(void)
{
 char num[20];
    num[0] = '3';
    num[1] = 'a';
 
 void test(num);
}
 
 void test(char num[])
{
 for(a = 0; a < 20; a++) 
 {
  printf("%c",num);
 }

 printf("%c",num[0]);
}