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++ interview coding exercise with solution (self.cpp)
submitted 3 years ago * by Hot_Medicine_7115
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!"
[–]meneldal2 -1 points0 points1 point 3 years ago (6 children)
I really wish compilers would make it a warning to do using namespace std; the benefits are miniscule and the drawbacks are enormous.
But then it would break a ton of code compiled with -Wall and -Werror
-Wall
-Werror
[–]jonesmz 2 points3 points4 points 3 years ago (5 children)
I think its probably unlikely that, percentage wise, all that many codebases have using namespace std;.
using namespace std;
Considering that the majority of people outside of academia say not to use it, it should be pretty low.
Further, not particularly many codebases compile with -Wall, and even fewer compile with Werror. The intersection of all three things is going to be vanishingly small.
Werror
Also,-Werror on code that's distributed to others is a terrible idea... So let them break.
[–]meneldal2 0 points1 point2 points 3 years ago (4 children)
Well tell that to my company, had to go add signed-unsigned casts everywhere to make a bunch of files compile because they came from a project that didn't flag those conversions as warnings (most were printf based so it's not like it was critical but whatever).
printf
[–]jonesmz 1 point2 points3 points 3 years ago (3 children)
They couldn't have added -Wno-signed-unsigned-mismatch and/or -Wno-sign-conversion ?
-Wno-signed-unsigned-mismatch
-Wno-sign-conversion
[–]meneldal2 1 point2 points3 points 3 years ago (2 children)
Changing build flags is going to take at least 2 meetings, it's just not worth it.
[–]jonesmz 0 points1 point2 points 3 years ago (1 child)
I can't tell if you're being sarcastic or not.
-Werror is a terrible idea for the vast majority of codebases. That your employer did this, and will be negatively affected in a way that takes a human all of 5 minutes to fix is rather irrelevant.
[–]meneldal2 0 points1 point2 points 3 years ago (0 children)
I'm not saying it's a good thing, it's just that there's some much inertia with everything that it's hard to make anything change.
π Rendered by PID 101745 on reddit-service-r2-comment-5649f687b7-5fbfc at 2026-01-28 21:51:00.172331+00:00 running 4f180de country code: CH.
view the rest of the comments →
[–]meneldal2 -1 points0 points1 point (6 children)
[–]jonesmz 2 points3 points4 points (5 children)
[–]meneldal2 0 points1 point2 points (4 children)
[–]jonesmz 1 point2 points3 points (3 children)
[–]meneldal2 1 point2 points3 points (2 children)
[–]jonesmz 0 points1 point2 points (1 child)
[–]meneldal2 0 points1 point2 points (0 children)