J
John Taylor
Hello,
I have another doubt about C99 language syntax, this time with function
definitions. I don't understand why it is not possible to define a
function "x" in the following way:
int x {return 0;}
Let me explain. A <function-definition> can be defined as
<declaration-specifiers> <declarator> <compount-statement>. In my case,
<declaration-specifiers> is "int", <declarator> is "x" and the
<compound-statement> is "{return 0;}" I read the constrains in section
6.9.1 but I couldn't manage to found the point in which the standard
forbids similar code.
Of course for the piece of code to be compiled I also must have added
the corresponding function declaration, that would look such as an
integer declaration:
int x;
All of this is very weird to me.
Thanks for any explaination.
I have another doubt about C99 language syntax, this time with function
definitions. I don't understand why it is not possible to define a
function "x" in the following way:
int x {return 0;}
Let me explain. A <function-definition> can be defined as
<declaration-specifiers> <declarator> <compount-statement>. In my case,
<declaration-specifiers> is "int", <declarator> is "x" and the
<compound-statement> is "{return 0;}" I read the constrains in section
6.9.1 but I couldn't manage to found the point in which the standard
forbids similar code.
Of course for the piece of code to be compiled I also must have added
the corresponding function declaration, that would look such as an
integer declaration:
int x;
All of this is very weird to me.
Thanks for any explaination.