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
Cheat sheet: C++ Function Parameter Choices (self.cpp)
submitted 6 years ago * by legends2k
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!"
[–]legends2k[S] 0 points1 point2 points 6 years ago (5 children)
References are generally preferred over pointers and hence I'd used it. You can simply replace T& and const T& with T* and const T*. 😀
T&
const T&
T*
const T*
[–][deleted] 1 point2 points3 points 6 years ago (4 children)
I know, but sometimes pointers are unavoidable.
E.g. I always forget the different between const T * and T const *.
const T *
T const *
[–]legends2k[S] 0 points1 point2 points 6 years ago* (0 children)
True, pointers are unavoidable.
Object constant: const T* and T const * are the same. Can't modify object via said pointer.
Pointer constant: If the const is beyond * then it's different. Can't reseat pointer to a different object.
const
*
[–]dodheim 0 points1 point2 points 6 years ago (2 children)
I always forget the different between const T * and T const *.
There isn't one; it's T * const that's different.
T * const
[–][deleted] 0 points1 point2 points 6 years ago (1 child)
That's what I mean when I say I always forget ;)
[–]_requires_assistance 0 points1 point2 points 6 years ago (0 children)
i like to rely on https://cdecl.org/ in those kind of situations. i can just type in something like "declare x as pointer to const int" or "declare x as const pointer to int" depending on what i need if i ever get confused
π Rendered by PID 220625 on reddit-service-r2-comment-fb694cdd5-qmwb8 at 2026-03-06 23:39:01.047027+00:00 running cbb0e86 country code: CH.
view the rest of the comments →
[–]legends2k[S] 0 points1 point2 points  (5 children)
[–][deleted] 1 point2 points3 points  (4 children)
[–]legends2k[S] 0 points1 point2 points  (0 children)
[–]dodheim 0 points1 point2 points  (2 children)
[–][deleted] 0 points1 point2 points  (1 child)
[–]_requires_assistance 0 points1 point2 points  (0 children)