Ask
your own question, for FREE!
Computer Science
17 Online
OpenStudy (anonymous):
Give output of following code.
#include
int m=5; void check();
void main( )
{ int m=20;
{
int m=10*::m;
cout<<"m="<
Join the QuestionCove community and study together with friends!
Sign Up
OpenStudy (anonymous):
@shubhamsrg
OpenStudy (shubhamsrg):
I have forgotten almost all in c.sc. Still i can try
though @DLS can help you most probably.
OpenStudy (shubhamsrg):
won't there be error "multiple declaration of m" ?
OpenStudy (shubhamsrg):
in void main()
OpenStudy (shubhamsrg):
and, again, how did my comment get up! -__-
Join the QuestionCove community and study together with friends!
Sign Up
OpenStudy (dls):
m=50 ::m=5
m=20 ::m=6
OpenStudy (dls):
::m=7 m=20
OpenStudy (dls):
thats it
OpenStudy (anonymous):
Can u Explain....its working
OpenStudy (dls):
What does :: do?
Join the QuestionCove community and study together with friends!
Sign Up
OpenStudy (anonymous):
idk
OpenStudy (dls):
:/
OpenStudy (dls):
It refers to the global variable for short
OpenStudy (dls):
If I have a program,where
#include<iostream.h>
int x=5;
void main()
{
int x=10;
cout<<x;
|
OpenStudy (dls):
can you tell the outupt
Join the QuestionCove community and study together with friends!
Sign Up
OpenStudy (anonymous):
10
OpenStudy (dls):
why not 5?
OpenStudy (anonymous):
(i) Execution starts from main function
(ii) Overwrite
OpenStudy (dls):
NO!
Who told you overwrite?!
Can't find your answer?
Make a FREE account and ask your own questions, OR help others and earn volunteer hours!
Join our real-time social learning platform and learn together with your friends!