Function definition into main() function.

C

CViniciusM

Hello,

Is the code below obey the ISO/IEC 9899:1999?

Thanks in advance, Vinicius.

#include <stdio.h>
#include <stdlib.h>

int main(void)
{
int a = 10;

void print()
{
printf("a = %d\n\n", a);
}

print();

return 0;
}
 
L

Lew Pitcher

CViniciusM said:
Hello,

Is the code below obey the ISO/IEC 9899:1999?

Thanks in advance, Vinicius.

No, it isn't ISO C.

ISO C does not support the sort of "function defined within the body of
a function" that you have coded below.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,262
Messages
2,571,056
Members
48,769
Latest member
Clifft

Latest Threads

Top