r/ProgrammerAnimemes • • Feb 28 '22

It really does though

1.3k Upvotes

38 comments sorted by

View all comments

Show parent comment

0

u/[deleted] Feb 28 '22

[deleted] — view deleted comment

40

u/Dark_Lord9 Feb 28 '22 edited Mar 01 '22

Basically it goes to a random location in memory and reads the int stored in it. Also note that this will certainly result in a segfault as you are accessing a memory location you most likely shouldn't be accessing.

5

u/Johanno1 Mar 01 '22

Segfault still returns somewhere

17

u/darkdog46 Feb 28 '22

No it just a gets a random int, gets a random pointer like you said, then dereferences whatever is there