I tried to run this
int array( void )
{
char text[12] = { 112, 114, 111, 103, 112, 0 };
int i;
for(i = 0; text[i]; i = i +1)
printf("%c", text[i]);
printf("\n");
return 0;
}
int main( void )
{
int array(void);
return 0;
}
and the program starts, but I get no result. Now, when I use the main function to define the program:
int main( void )
{
char text[12] = { 112, 114, 111, 112, 0 };
int i;
for(i = 0; text[i]; i = i +1)
printf("%c", text[i]);
printf("\n");
return 0;
}
I get the result progr(optional). I have already searched, but the only questions related to it are regarding the use mainof a function as a name and incorrect outputs. Maybe I was looking for the wrong way, but I would be glad if someone could answer this question.
source
share