But assuming it doesn’t the context is p_ch = the bits above… the code declaring p_ch isn’t shown but I’m guessing that the value here is actuality a pointer to a pointer so nothing illegal would be happening.
Lastly… C++ is really lacking in guarantees so you can assign a char to the first byte of an integer - C++ doesn’t generally care what you do unless you go out of bounds.
The reason I’m casting to void* is just pure comedy.
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmerhumor@lemmy.ml
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
Posts must be relevant to programming, programmers, or computer science.
No NSFW content.
Jokes must be in good taste. No hate speech, bigotry, etc.
Much better… but can we make it
*((void*)(p = p + 1))
?Why are you casting to
void*
? How is the compiler supposed to know the size of the data you are dereferencing?This would probably cause a compiler error…
But assuming it doesn’t the context is
p_ch =
the bits above… the code declaring p_ch isn’t shown but I’m guessing that the value here is actuality a pointer to a pointer so nothing illegal would be happening.Lastly… C++ is really lacking in guarantees so you can assign a char to the first byte of an integer - C++ doesn’t generally care what you do unless you go out of bounds.
The reason I’m casting to void* is just pure comedy.
How about some JavaScript
p+=[]**[]
?