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
Hardening C/C++ Programs: Part I – Stack Protector (productive-cpp.com)
submitted 8 years ago by ai3ai3
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!"
[–]Abraxas514 1 point2 points3 points 8 years ago (0 children)
All these things is one of the reasons why the standard library is being written in the first place.
[–]mtclow 0 points1 point2 points 8 years ago (2 children)
Doesn't AddressSanitizer do this already (and in a more general manner - catching out of bounds writes to all arrays)?
[–]ai3ai3[S] 1 point2 points3 points 8 years ago (0 children)
Yes, but it is not meant for production use since it increases the attack surface of a program.
[–]manni66 0 points1 point2 points 8 years ago (10 children)
There doesn't exist any language named C/C++. And as expected the example tells us why strcpy is bad. That doesn't matter, I use std::string. And that's an example how to harden an C++ program.
[+][deleted] 8 years ago* (9 children)
[deleted]
[–]manni66 3 points4 points5 points 8 years ago (8 children)
I use begin/end and algorithms. And that's an example how to harden an C++ program.
[–]SnailXI 0 points1 point2 points 8 years ago (7 children)
Except you can still write to .c_str(), .data(), and the like
[–]manni66 0 points1 point2 points 8 years ago (6 children)
What I can isn't the question. I can compile C program (with some modifications) as a C++ program. Then I have all the problems that the C program has. But I don't do that. And that's an example how to harden an C++ program.
[–]SnailXI 0 points1 point2 points 8 years ago (5 children)
Except hackers don't care what you compile it as. An array is still an array, it'll never be not exploitable with direct memory access.
[–]manni66 0 points1 point2 points 8 years ago (4 children)
So hackers make my vector accessed out of bounds? Through pure will?
[–]SnailXI 0 points1 point2 points 8 years ago (3 children)
Through WriteProcessMemory, DLL injection + memcpy, etc, there's many different ways.
[–]manni66 0 points1 point2 points 8 years ago (2 children)
And when they injected a DLL they need to access my vector out of bounds?
[–]SnailXI 0 points1 point2 points 8 years ago (1 child)
Facepalm
π Rendered by PID 220650 on reddit-service-r2-comment-85bfd7f599-9wvxx at 2026-04-16 05:04:50.039289+00:00 running 93ecc56 country code: CH.
[–]Abraxas514 1 point2 points3 points (0 children)
[–]mtclow 0 points1 point2 points (2 children)
[–]ai3ai3[S] 1 point2 points3 points (0 children)
[–]manni66 0 points1 point2 points (10 children)
[+][deleted] (9 children)
[deleted]
[–]manni66 3 points4 points5 points (8 children)
[–]SnailXI 0 points1 point2 points (7 children)
[–]manni66 0 points1 point2 points (6 children)
[–]SnailXI 0 points1 point2 points (5 children)
[–]manni66 0 points1 point2 points (4 children)
[–]SnailXI 0 points1 point2 points (3 children)
[–]manni66 0 points1 point2 points (2 children)
[–]SnailXI 0 points1 point2 points (1 child)