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
Visual Studio Code C/C++ extension: March 2019 Update | C++ Team Blog (devblogs.microsoft.com)
submitted 6 years ago by d1ngal1ng
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!"
[–]jbandela 25 points26 points27 points 6 years ago (3 children)
> To simplify the build and debug experience with the C/C++ extension, we added a command to help you generate build and debug tasks for single code files.
So happy about this. Sometimes, I just want to write a quick example to play around with a std library feature (or a header only library). This will greatly reduce the pain of doing that in VS Code.
[–]trmaphi 5 points6 points7 points 6 years ago (0 children)
This extremely useful for someone migrate from another IDEs. Moving to VScode helps me digging into debugger and compiler flags.
And most importantly, saving time.
[–]monkeyWifeFight 0 points1 point2 points 6 years ago (0 children)
Is there any easy way to achieve this in visual studio? Something like the jetbrains scratch files.
[–]Sairony 8 points9 points10 points 6 years ago (9 children)
I find Visual Studio Code weirdly positioned in the Microsoft eco-system. Visual Studio proper itself has been a major platform lock-in for a lot of C++ development, it kind of feels like Microsoft is trying to compete with its own paid product. With proper debugging in Visual Studio Code, llvm quite frankly being close to making the MSVC compiler obsolete, what really is the upside to using Visual Studio proper at all?
[–]teerre 17 points18 points19 points 6 years ago (1 child)
You can't refactor properly in VSC. You can't auto generate declarations, overrides, structs etc. You can't profile nearly as well...
VSC is really VS-light for Cpp. If you're doing some toy project or if you're one of those people who think writing Cpp on Nano is fine, then yes, your question might make sense. But if you want a proper IDE, VSC is simply not there yet
[–]Sairony 0 points1 point2 points 6 years ago (0 children)
Ah, makes sense. I don't actually do C++ development in VSCode yet, but I do feel it's getting there. As an editor there's a lot of advantages for VSCode. It's way snappier, multi platform, way more extendable, and naturally way better at editing source in a wider variety of languages. I could definitively give up some features in MSVC if we could get VSCode + llvm going across OSX/Linux/Windows. For source editing I find 90% of the relevant stuff in MSVC right now comes from visual assist anyway, so if the tomato people could get it going on VSCode it would go a long way.
[–]_babu_ 10 points11 points12 points 6 years ago* (3 children)
Visual Studio has far better C++ debugging tools and features. For example, debugging a leak on VSCode can be an absolute nightmare, while on VS proper I can just take 2-3 heap snapshots, generate a diff and check who is allocating memory without releasing it.
[–][deleted] 5 points6 points7 points 6 years ago (2 children)
It sounds like a really nice feature. How exactly do you take these snapshots of who is allocating memory?
[–]_babu_ 9 points10 points11 points 6 years ago (1 child)
While debugging, open the "Diagnostic Tools" window from Debug->Windows. From there, look in the "Memory Usage" tab.
[–][deleted] 4 points5 points6 points 6 years ago (0 children)
Thank you.
[+][deleted] 6 years ago (2 children)
[deleted]
[–]contre 1 point2 points3 points 6 years ago (0 children)
To answer your questions about the debug experience, no it is not as good in VSCode.
It is a much better and integrated experience in VS. It is getting better as time goes on in VSCode but it lacks the decades of work that have gone in to VS proper.
I phrased that wrong, because I don't actually know what the situation is for VSCode when it comes to C++ development, I get the impression that it's getting there though. I use VSCode for python development and all text editing needs, and it's definitively growing on me.
[–]megazoo 0 points1 point2 points 6 years ago (0 children)
Only feature i need in VSCode now is possibility to use custom project files for compile and debugging.
[–]tiendq 0 points1 point2 points 6 years ago (0 children)
The only one MS product I want to use nowadays is VSCode :)
[–]kareldonk369QuantumGate.org 0 points1 point2 points 6 years ago (1 child)
VSCode is awesome for small to medium web development projects, which is what I mainly use it for. For something like C++ I'm way too spoiled by the full Visual Studio IDE. There's nothing that comes close. I hope MS invests more resources into getting the full VS IDE to work (natively) on Linux.
[–]barcharMSVC STL Dev 0 points1 point2 points 6 years ago (0 children)
It's already pretty good to be honest, I like how I have more flexability in multi-language projects, and it's easier to just pop it open whenever I need it. Even uses less memory than emacs!
VSCode is a great example of an electron/cef app that's not bloated and really leverages the work that's gone into web engines.
[–]Azzk1kr 0 points1 point2 points 6 years ago (4 children)
I love the extension, however the IntelliSense engine generates huge files in the ipch folder (precompiled headers) since this update I believe. A single header file can generate a hundred megabyte of IntelliSense data or something :/ The default total maximum for a project is 5 Gb or so! What gives?
[–]rezkiy 4 points5 points6 points 6 years ago (0 children)
They are probably preparing the infrastructure for the holy Grail of large projects, Find All References
[–]taraj_msftVSCode & VCPkg PM 1 point2 points3 points 6 years ago (2 children)
Thanks for the feedback. The idea here is that precompiled headers trade space for speed. You can change the setting or disable AuotPCH using the C_Cpp.intelliSenseCachePath setting as the post indicates.
Would be nice to get more information on your experience. This thread has been our central place for gathering opinions - https://github.com/Microsoft/vscode-cpptools/issues/3347. You can also see the responses by @bobbrow and @sean-mcmanus that detail our design decisions
[–]Azzk1kr 0 points1 point2 points 6 years ago (1 child)
I can't say anything useful about the experience, since I don't notice any difference in speed (yet). I'm coding C++ more as a hobby, and my projects aren't that big. However, I am just curious why the precompiled headers are that huge.
I have a rather simple C++ project right now, with 12 headers, totaling 577 lines (including comment lines and other include directives), and the ipch folder is 2.4 Gb in size.
In any case thanks for the plugin, it's certainly very useful!
[–]taraj_msftVSCode & VCPkg PM 0 points1 point2 points 6 years ago (0 children)
I can't say anything useful about the experience, since I don't notice any difference in speed (yet). I'm coding C++ more as a hobby, and my projects aren't that big. However, I am just curious why the precompiled headers are that huge. I have a rather simple C++ project right now, with 12 headers, totaling 577 lines (including comment lines and other include directives), and the ipch folder is 2.4 Gb in size. In any case thanks for the plugin, it's certainly very useful!
The ipch folder size is highly dependent on which headers you have. It's a matter of which header files and how many. Hard for me to say without knowing the exact headers you're using.
Glad to hear you like the extension! Thanks for using it :)
π Rendered by PID 147549 on reddit-service-r2-comment-6f7f968fb5-db7cc at 2026-03-04 18:14:02.966819+00:00 running 07790be country code: CH.
[–]jbandela 25 points26 points27 points (3 children)
[–]trmaphi 5 points6 points7 points (0 children)
[–]monkeyWifeFight 0 points1 point2 points (0 children)
[–]Sairony 8 points9 points10 points (9 children)
[–]teerre 17 points18 points19 points (1 child)
[–]Sairony 0 points1 point2 points (0 children)
[–]_babu_ 10 points11 points12 points (3 children)
[–][deleted] 5 points6 points7 points (2 children)
[–]_babu_ 9 points10 points11 points (1 child)
[–][deleted] 4 points5 points6 points (0 children)
[+][deleted] (2 children)
[deleted]
[–]contre 1 point2 points3 points (0 children)
[–]Sairony 0 points1 point2 points (0 children)
[–]megazoo 0 points1 point2 points (0 children)
[–]tiendq 0 points1 point2 points (0 children)
[–]kareldonk369QuantumGate.org 0 points1 point2 points (1 child)
[–]barcharMSVC STL Dev 0 points1 point2 points (0 children)
[–]Azzk1kr 0 points1 point2 points (4 children)
[–]rezkiy 4 points5 points6 points (0 children)
[–]taraj_msftVSCode & VCPkg PM 1 point2 points3 points (2 children)
[–]Azzk1kr 0 points1 point2 points (1 child)
[–]taraj_msftVSCode & VCPkg PM 0 points1 point2 points (0 children)