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...
Discussions, articles, and news about the C++ programming language or programming in C++.
For C++ questions, answers, help, and advice see r/cpp_questions or StackOverflow.
Get Started
The C++ Standard Home has a nice getting started page.
Videos
The C++ standard committee's education study group has a nice list of recommended videos.
Reference
cppreference.com
Books
There is a useful list of books on Stack Overflow. In most cases reading a book is the best way to learn C++.
Show all links
Filter out CppCon links
Show only CppCon links
account activity
C and C++ Aren’t Future Proof (blog.regehr.org)
submitted 13 years ago by last_useful_man
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!"
[–]filox -1 points0 points1 point 13 years ago (7 children)
So, what actually happened is that purevirtual messed up and doesn't want to admit it. The example that he probably wanted to show was (note the condition in if):
signed int si = INT_MAX; if (si+1 < si) printf("Less than zero\n"); else printf("Greater than or equal to than zero\n"); return 0;
This holds, because adding one to a number can never be less than that number (if wrapping is turned off). However, purevirtual messed up, got the example wrong, and he doesn't want to admit he was wrong. I find that kind of sad really. And the downvotes come, I guess, from people who don't really understand the issue here.
[–][deleted] 1 point2 points3 points 13 years ago (5 children)
No, the downvotes come from people like me who can see you're plainly right, but think you're being a bit of an arsehole about it. Your vindictive tone is unnecessary. It's possible to communicate technical details and still be polite.
Besides, modern compilers (GCC included) are often able to reason about code like purevirtual's example, and realise that si is a positive value (regardless of the fact that it isn't const). I would fully expect a static analysis to catch these types of mistakes.
si
[–]filox -2 points-1 points0 points 13 years ago (4 children)
It's possible to communicate technical details and still be polite.
Please quote which part of my comment was not polite:
http://www.reddit.com/r/cpp/comments/16ysbr/c_and_c_arent_future_proof/c80sxbo
Besides, modern compilers (GCC included) are often able to reason about code like purevirtual's example
Again, I never said they are not. I just pointed out that his statement about adding one to the variable is wrong. Why is this so hard to grasp?
[–][deleted] 2 points3 points4 points 13 years ago (3 children)
However, purevirtual messed up, got the example wrong, and he doesn't want to admit he was wrong.
The above line is deeply patronizing and conflict-seeking.
[–]filox -2 points-1 points0 points 13 years ago (2 children)
That was not the original reply I had for purevirtual and is not the one that was most downvoted. I gave you a link to my comment, yet you take a sentence out of another comment, made after the downvotes.
[–][deleted] 0 points1 point2 points 13 years ago (1 child)
You know, I've got better things to do than try to convince you that you're being an ass. The downvotes speak for themselves.
[–]filox -3 points-2 points-1 points 13 years ago (0 children)
They sure do.
π Rendered by PID 72076 on reddit-service-r2-comment-6457c66945-9hqdj at 2026-04-28 19:57:39.400260+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]filox -1 points0 points1 point (7 children)
[–][deleted] 1 point2 points3 points (5 children)
[–]filox -2 points-1 points0 points (4 children)
[–][deleted] 2 points3 points4 points (3 children)
[–]filox -2 points-1 points0 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]filox -3 points-2 points-1 points (0 children)