0

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]);
}
2
Contributors
1
Reply
3
Views
6 Years
Discussion Span
Last Post by rubberman
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.