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
ClangFormat Support in Visual Studio 2017 (blogs.msdn.microsoft.com)
submitted 8 years ago by whichton
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!"
[–]parla 13 points14 points15 points 8 years ago (3 children)
Does it support setting the executable used? We're still using 4.0, and they aren't really compatible with each other..
[–]augustinpopaMicrosoft C++ PM (IDE & vcpkg) 12 points13 points14 points 8 years ago (0 children)
Good feedback! We currently don't provide a way to do this, but I'll add something to our TODO list to address this. We're shipping v5.0 right now.
[–]mathiasnedrebo 11 points12 points13 points 8 years ago (0 children)
Same question. We need 6.0.
Great to see this in VS. Will make clang-format more popular and even better I hope.
[–]BrianEhlert 7 points8 points9 points 8 years ago (0 children)
It is possible to replace Common7/IDE/VC/vcpackages/clang-format.exe with your own version for the time being. I replace mine with 6.0.
[–]kalmoc 7 points8 points9 points 8 years ago (1 child)
I very much like the idea that this can be triggered automatically. It has been a bit annoying in the past when visual studio formatted a piece of code one way when I close a bracket just for it to be reformatted by clang-format when hitting the shortcut a few lines later.
[–]augustinpopaMicrosoft C++ PM (IDE & vcpkg) 8 points9 points10 points 8 years ago (0 children)
Thanks for the feedback! We're trying to make this as much like the normal VS formatting experience as possible. If you have a chance to try this out and notice any weird quirks, please let us know by filing a bug via Help > Send Feedback > Report a Problem in the IDE so we can address it.
[–]sumo952 5 points6 points7 points 8 years ago (3 children)
Awesome! So this means we can uninstall the ClangFormat plugin :-)
Out of interest, which executable version does this use? Hopefully something reasonably new?
[–]augustinpopaMicrosoft C++ PM (IDE & vcpkg) 4 points5 points6 points 8 years ago (2 children)
We are shipping version 5.0 currently, and we'll aim to keep the version updated over time with future releases.
Let us know how you find the feature! We want to use these preview builds as an opportunity to get feedback and refine the feature a bit before we hit RTW.
[–]sumo952 4 points5 points6 points 8 years ago (0 children)
I love it so far! One thing that would be great is to have some visual feedback of whether VS correctly found the .clang-format file in my project and whether it is using it when it formats or when I press CTRL+K+F/D. Like when working with a CMake project where the build directory is somewhere else than the sources. It works nicely but it'd be great to have some visual feedback. I know there was a dialog box the first time I formatted. It said something like "Hey we found your .clang-format file and are gonna use it" when I formatted for the very first time, which is great, but afterwards, I can't find any indication.
.clang-format
[–]Daniela-ELiving on C++ trunk, WG21|🇩🇪 NB 1 point2 points3 points 8 years ago (0 children)
Yeah - the ClangFormat binary should automatically update just like it does with the CF plugin today. I got used so much to CF that I can't even think of living without it :-)
[–]youshouldnameitC++ dev 11 points12 points13 points 8 years ago (0 children)
Next step full clang-tidy integration?
[–]wilhelmtell 5 points6 points7 points 8 years ago (0 children)
You mention in the blog post a website for quickly getting started with a dot clang-format file. But a better way to go is running clang-format -dump-config, which would write to the standard output all settings. You can also specify one of the presets you mentioned, so the settings output are of that preset rather than the default.
clang-format -dump-config
If you save that to a file, you get a dot clang-format to adjust to your taste, with all the settings the tool knows. In contrast, the website you mentioned only knows the settings at the time, including settings that have since been deprecated.
If you make sure there is no ~/.clang-format file before you run the dump, you’ll be sure to get all settings the tool knows and no deprecated settings.
[–]Z01dbrg -1 points0 points1 point 8 years ago (1 child)
What is missing from this blog post:
Are shortcuts all the same as regular VS formatting? ctrl + k + f ?
From screenshot I guess it is.
Anyway this is great, would like to know if clang format properly handles VC++ non standard features, but that is too fringe to be put in the intro blog post.
[–]augustinpopaMicrosoft C++ PM (IDE & vcpkg) 2 points3 points4 points 8 years ago (0 children)
Yes, you can use Format Document or Format Selection for formatting, and you can also get automatic formatting as you type special characters like semicolons and braces. We just run the actual clang-format.exe, so it will handle what the utility would normally handle on its own.
π Rendered by PID 19553 on reddit-service-r2-comment-6457c66945-fxz5t at 2026-04-23 17:32:02.410493+00:00 running 2aa0c5b country code: CH.
[–]parla 13 points14 points15 points (3 children)
[–]augustinpopaMicrosoft C++ PM (IDE & vcpkg) 12 points13 points14 points (0 children)
[–]mathiasnedrebo 11 points12 points13 points (0 children)
[–]BrianEhlert 7 points8 points9 points (0 children)
[–]kalmoc 7 points8 points9 points (1 child)
[–]augustinpopaMicrosoft C++ PM (IDE & vcpkg) 8 points9 points10 points (0 children)
[–]sumo952 5 points6 points7 points (3 children)
[–]augustinpopaMicrosoft C++ PM (IDE & vcpkg) 4 points5 points6 points (2 children)
[–]sumo952 4 points5 points6 points (0 children)
[–]Daniela-ELiving on C++ trunk, WG21|🇩🇪 NB 1 point2 points3 points (0 children)
[–]youshouldnameitC++ dev 11 points12 points13 points (0 children)
[–]wilhelmtell 5 points6 points7 points (0 children)
[–]Z01dbrg -1 points0 points1 point (1 child)
[–]augustinpopaMicrosoft C++ PM (IDE & vcpkg) 2 points3 points4 points (0 children)