cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
*(long*)0 = 0
*(long*)0 = 0
Nov 5, 2010 at 7:49pm UTC
nguyentrang
(21)
*(
long
*)0 = 0;
What does this line of code do?
Nov 5, 2010 at 8:37pm UTC
Disch
(13742)
It will likely crash your program.
Nov 5, 2010 at 8:43pm UTC
helios
(17574)
It interprets address 0 as a pointer to a long and assigns zero to the long stored there. 0 is by definition an invalid pointer, so, as Disch said, the program is very likely to crash if you try to do that.
Nov 5, 2010 at 8:46pm UTC
m4ster r0shi
(2201)
That is unless you are Chuck Norris, because, as we all know,
Chuck Norris can dereference both null and void pointers.
Nov 5, 2010 at 9:01pm UTC
firix
(438)
the program has crashed.If you do not, of course you something different.
Topic archived. No new replies allowed.