Groups
Groups
Sign in
Groups
Groups
Knowledge Test
Conversations
About
Send feedback
Help
&main
1 view
Skip to first unread message
TheSuyog
unread,
Aug 10, 2010, 11:54:06 AM
8/10/10
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Knowledge Test
Hello everybody!
Whats supposed to happen if we run this code:
void main()
{
cout<<&main;
}
Try to answer this without running...
SONALI-
unread,
Aug 10, 2010, 12:00:06 PM
8/10/10
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to knowledge-...@googlegroups.com
some particular addresss where the main function store in memory..hope it is correct..lemme knw
TheSuyog
unread,
Aug 10, 2010, 12:03:37 PM
8/10/10
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Knowledge Test
will let u know once most of (active) members have answerred it....
Ravina soni
unread,
Aug 10, 2010, 12:42:31 PM
8/10/10
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to knowledge-...@googlegroups.com
It'll nt run give a error
nt nly for main even for any fun like cout<<&fun is nt the right way to print it's address
cout<<(void*)main;
cout<<(void*)fun;
print the address of funtion
I think function name is reference, contaning address of function
SONALI-
unread,
Aug 10, 2010, 12:47:19 PM
8/10/10
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to knowledge-...@googlegroups.com
yup function main contain address as every instuction and evry function of program starts at particular address..
so if we us the pointer operator '&' (called "address of " sign) returns the address of the main function..:)
Reply all
Reply to author
Forward
0 new messages