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.
well yeah, but you can also use semi colon in python in order to put two (or more) instructions in the same line that otherwise you put in two lines (with the same indentation level), for example
def fun():print(1);print(2);return 0;
is a valid python code, tho the normal use case for it is more to pass code via command line in string form to the unittest module or something like that.
So in short, it can also be python (If you want to be obtuse with it I guess :p)
It's mostly not different -- pointer value 0 must always represent a null pointer in C, even if it's represented differently in hardware. NULL can therefore be 0 or (void *)0, or something to that effect.
64
u/[deleted] Feb 28 '22
Wow
19
u/[deleted] Feb 28 '22 edited Jun 03 '24
reply chase sable pet shaggy wistful gaping sleep selective fuzzy
This post was mass deleted and anonymized with Redact
7
u/[deleted] Feb 28 '22
I do like me a good Eva meme
75
u/[deleted] Feb 28 '22
return *((int *)random());
63
u/Chris_Hex Feb 28 '22
For anyone who's curious, the song is "Komm, süsser Tod", which means "Come, sweet Death"
The song was written for the movie The End of Evangelion by its director, Hideaki Anno, and translated into English for the recording.
35
u/gogo94210 Feb 28 '22
Would have been better if your returned
null3
u/[deleted] Feb 28 '22
Hits a little too deep
3
u/Zekiz4ever Mar 01 '22
more like
2
u/WennoBoi Feb 28 '22
u/savevideo
2
u/[deleted] Feb 28 '22
Would be even better if it was Julia’s “return nothing”
2
u/Taumito Mar 01 '22
dd if=/dev/null of=/dev/sda11
u/Brahms16 Mar 01 '22
I'd say return (void*) 0;
1
u/KillaIsCringeBoss Mar 01 '22
It all returns to nothing…
1
u/undeadpickels May 23 '22
This is probably at the bottom of a huge function that you will spend lots of time looking over the find the bug.
0
u/[deleted] Mar 01 '22
[deleted] — view deleted comment
30
u/[deleted] Feb 28 '22
[removed] — view removed comment