V
venky
Hi
main() {
int x; /* it declaration or defination??*/
}
main() {
int x; /* it declaration or defination??*/
}
venky said:main() {
int x; /* it declaration or defination??*/
}
venky said:Hi
main() {
int x; /* it declaration or defination??*/
}
int x; is always a definition;
extern int x; may be a declaration.
venky said:int x; /* it declaration or defination??*/
eahaa said:int x; /*is a declaration */
declaration
venky said:main() {
int x; /* it declaration or defination??*/
}
Hi
main() {
int x; /* it declaration or defination??*/
}
Mark said:Its a declaration and a tentative definition, which will become a firm
definition if no other definition is encountered.
Mark McIntyre said:Its a declaration and a tentative definition, which will become a firm
definition if no other definition is encountered.
Hi Mark,
Now I'm wondering:
How would another definition in the same scope be syntactically valid?
The top-poster says it's a declaration, which it is,
No, it is at block level, so it is clearly a _definition_ of an
uninitialised variable of type int named x on storage class auto.
venky said:Hi
main() {
int x; /* it declaration or defination??*/
}
Herbert said:No, it is at block level, so it is clearly a _definition_ of an
uninitialised variable of type int named x on storage class auto.
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.