Live data from Hacker News

*(char*)0 = 0; – What does the C++ programmer intend with this code? [video]

youtube.com

171–180 of 199 posts

Re: *(char*)0 = 0; – What does the C++ programmer intend with this code? [video]

#174
post #11

Afaik, that's a "portable" way to trigger a termination with dump collection :) (particularly on Windows if you just std::terminate you won't get a heap dump unless you do special WER registration and register handlers).

Ah, but is it really valid MS windows way if don't cast to blue?

Re: *(char*)0 = 0; – What does the C++ programmer intend with this code? [video]

#176

For the typical non-coder hacker news reader: Wait for C++ coder to get disney sponsorship for a stack frame version of/translation to George Lucas expressions / Steven Speilburg expressions. aka * wars vs. * trek crossover comparisons, perhaps with less () than lisp/scheme take. Ideally, in UTF format so no "7 samuri/8 bit kleen", AND/OR, lower API, protocol droids distractions. In interm, learn python, show a pytho…

&*strato[cast] to over the top reference for current history?

Re: *(char*)0 = 0; – What does the C++ programmer intend with this code? [video]

#177
post #118
post #25

When I see that code my head immediately translates to "store a byte with value 0 at memory address zero". 0 the integer needs to be cast to a char * to treat it as a byte address (rather than a word) and the * means "assign to the memory location given by the pointer. I would probably use something like this when hacking on an Apple II with a zero page. I have also written programs that ran on VMS which dumped memor…

You're mostly correct but to be pedantic, in C the literal value 0 does not actually mean address 0. The literal value of 0 is an implementation defined value that represents a null pointer, but that value does not have to be address 0, it could be some other address. This is significant because the following two snippets of code are not required to be equal in C. char* c = (char*)(0); char* d; memset(&d, 0, sizeof(d…

How do you reference literal address 0, then? From how you describe it sounds different from literal address 1, etc.

Re: *(char*)0 = 0; – What does the C++ programmer intend with this code? [video]

#178

For the typical non-coder hacker news reader: Wait for C++ coder to get disney sponsorship for a stack frame version of/translation to George Lucas expressions / Steven Speilburg expressions. aka * wars vs. * trek crossover comparisons, perhaps with less () than lisp/scheme take. Ideally, in UTF format so no "7 samuri/8 bit kleen", AND/OR, lower API, protocol droids distractions. In interm, learn python, show a pytho…

Grasshopper observational note:

"Eigen Maze by this pointer" may be theme song for this post; but no letting things be in order to let this stack down to get this pointer back to complete 'init & kill -9' autonoma sequence.

Re: *(char*)0 = 0; – What does the C++ programmer intend with this code? [video]

#179

Kind of a tangent, but I've never seen that signature for main with char *apple at the end after char *envp. What's passed in there? Some googling let me know it's used on macOS, but every result was too generic to be helpful.

Originally a hidden HDD .sony thing

Re: *(char*)0 = 0; – What does the C++ programmer intend with this code? [video]

#180
post #80

Earlier quoted context omitted.

Ah fuck, I grepped the YouTube transcript for WASM/WebAssembly but I guess youtube's automatic captions aren't very good. I feel silly now for not watching the video before commenting.

This is the way ;)

With or without man (page) lore?
Post reply on HN