Give output of following code.
#include
@shubhamsrg
I have forgotten almost all in c.sc. Still i can try though @DLS can help you most probably.
won't there be error "multiple declaration of m" ?
in void main()
and, again, how did my comment get up! -__-
m=50 ::m=5 m=20 ::m=6
::m=7 m=20
thats it
Can u Explain....its working
What does :: do?
idk
:/
It refers to the global variable for short
If I have a program,where #include<iostream.h> int x=5; void main() { int x=10; cout<<x; |
can you tell the outupt
10
why not 5?
(i) Execution starts from main function (ii) Overwrite
NO! Who told you overwrite?!
Global variables are stored in "Data segment" of memory. And local variables at "Stack" They are completely 2 different parts of memory. http://www.tenouk.com/ModuleZ_files/cmemory003.png
Join our real-time social learning platform and learn together with your friends!