--- In [email protected], shivani gupta <[EMAIL PROTECTED]> wrote: > > i have never thought about this before... > main is a function name and as we know that a function name cant used as identifier for variables or constants.(as given in books). its really awkward to see that this program display the value for main as 657 (in my pc) > for the other program to display value a, the error for undefined has to come as its not defined . > probably in case of main... the value of main may be defined in c or c++. > > > --- On Fri, 10/31/08, Brett McCoy <[EMAIL PROTECTED]> wrote: > > From: Brett McCoy <[EMAIL PROTECTED]> > Subject: Re: [c-prog] obveious > To: [email protected] > Date: Friday, October 31, 2008, 8:02 PM > > > > > > > On Fri, Oct 31, 2008 at 10:12 AM, Manoj Vivek <vivek_jonam@ yahoo.com> wrote: > > observe the both snippets > > > > * > > main() > > { > > printf("%d", main); > > } > > > > * > > main() > > { > > printf("%d", a); > > } > > have you observed.... . The first snippet does not show any errors while second one shows an error as "unknown symbol a" ..., why please explain > > It should be obvious. You didn't declare a. > > -- Brett > ------------ --------- --------- --------- --------- --------- - > "In the rhythm of music a secret is hidden; > If I were to divulge it, it would overturn the world." > -- Jelaleddin Rumi > > main showed some value because it is predeclared function by the compiler it is defined by the user but its prototype is pre defined hence itis not giving any error
Mukesh Jadon > > > > > > > > > > > > > > > > [Non-text portions of this message have been removed] >
