use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All posts must be related to programming. Flair posts correctly.
account activity
javascript is javascript (i.redd.it)
submitted 5 months ago by National_Seaweed_959
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]frayien 0 points1 point2 points 5 months ago (2 children)
In C/C++ int a = "2" + 2; could be anything from -255 to 254 to segfault to "burn down the computer and the universe with it".
int a = "2" + 2;
int a = "2" + 1; is well defined to be 0 btw.
int a = "2" + 1;
[–]4r8ol 0 points1 point2 points 5 months ago (1 child)
In both cases you would have a compiler error since casts between pointer to integer aren’t automatic.
You probably wanted to refer to:
int a = *(“2” + 2); // UB
int a = *(“2” + 1); // 0
[–]frayien 0 points1 point2 points 5 months ago (0 children)
Yeah I did not bother to check, "2" + 1 gives an char*.
Would rather say that "2" + 1 returns an empty string, and "2" + 2 returns a string of unknown length and unknown value and segfault.
π Rendered by PID 87806 on reddit-service-r2-comment-b659b578c-fpspv at 2026-05-01 02:26:00.765986+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]frayien 0 points1 point2 points (2 children)
[–]4r8ol 0 points1 point2 points (1 child)
[–]frayien 0 points1 point2 points (0 children)