I am new to C and im trying to work with Global variables i ran this program and all get as output is “Hey there” Which is the first part of the program. The second part doesn’t get displayed. Here’s the code.
char count[20]="Hey there";
char dig[7]="pooop";
main()
{
puts(count);
return(0);
}
hey()
{
printf(" i %s you", dig);
return(0);
}
You need to call the second function
hey()before you can get its output.E.g., in
main()where exactly you put the call to
hey()inmain()is up to you (it needs to be before thereturnstatement though).