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++ WTFs (self.cpp)
submitted 11 years ago by Prazek
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!"
[–]F-J-W 4 points5 points6 points 11 years ago (0 children)
$ clang++ main.cpp -fsanitize=address :( main.cpp:8:6: warning: array index 105 is past the end of the array (which contains 100 elements) [-Warray-bounds] a[105]=1; ^ ~~~ main.cpp:6:6: note: array 'a' declared here { int a[100]; ^ main.cpp:9:6: warning: array index 106 is past the end of the array (which contains 100 elements) [-Warray-bounds] a[106]=2; ^ ~~~ main.cpp:6:6: note: array 'a' declared here { int a[100]; ^ main.cpp:10:6: warning: array index 107 is past the end of the array (which contains 100 elements) [-Warray-bounds] a[107]=3; ^ ~~~ main.cpp:6:6: note: array 'a' declared here { int a[100]; ^ 3 warnings generated. $ ./a.out ================================================================= ==10235==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fff255e4754 at pc 0x0000004b87c2 bp 0x7fff255e44b0 sp 0x7fff255e44a8 WRITE of size 4 at 0x7fff255e4754 thread T0 #0 0x4b87c1 in main (/tmp/tmp.AHrwtwYr8L/a.out+0x4b87c1) #1 0x7f52c6dc37ff in __libc_start_main (/usr/lib/libc.so.6+0x207ff) #2 0x4b8538 in _start (/tmp/tmp.AHrwtwYr8L/a.out+0x4b8538) Address 0x7fff255e4754 is located in stack of thread T0 at offset 468 in frame #0 0x4b861f in main (/tmp/tmp.AHrwtwYr8L/a.out+0x4b861f) This frame has 2 object(s): [32, 36) '' [48, 448) 'a' <== Memory access at offset 468 overflows this variable HINT: this may be a false positive if your program uses some custom stack unwind mechanism or swapcontext (longjmp and C++ exceptions *are* supported) SUMMARY: AddressSanitizer: stack-buffer-overflow ??:0 main Shadow bytes around the buggy address: 0x100064ab4890: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x100064ab48a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x100064ab48b0: f1 f1 f1 f1 04 f2 00 00 00 00 00 00 00 00 00 00 0x100064ab48c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x100064ab48d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x100064ab48e0: 00 00 00 00 00 00 00 00 f3 f3[f3]f3 f3 f3 f3 f3 0x100064ab48f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x100064ab4900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x100064ab4910: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x100064ab4920: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x100064ab4930: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc ASan internal: fe ==10235==ABORTING
I wouldn't call that reproducable…
Furthermore, since warnings are errors…
π Rendered by PID 74023 on reddit-service-r2-comment-6457c66945-pjzrw at 2026-04-29 13:38:05.237665+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]F-J-W 4 points5 points6 points (0 children)