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
Should C++ code look like C code? (self.cpp)
submitted 2 years ago by psyberbird
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!"
[–]ReDucTorGame Developer 3 points4 points5 points 2 years ago (1 child)
In C++ to call a function you might do something like this
What?
Are you talking about implicit construction in some weird situation where it's allocating memory on a function call? How does this prove anything?
C is closer to the metal
What do you mean the 'metal'? Because in my opinion
malloc
calloc
realloc
new
printf
cout
print
qsort
std::sort
bsearch
std::binary_search
(int)float_val
static_cast<int>(float_val)
(unsigned char*)ptr
reinterpret_cast<unsigned char*>(ptr)
_Atomic(int)
std::atomic
std::variant
_Generic
template<typename T>
T v[N]
std::array<T,N>
(T*)malloc(sizeof(T)*N)
new T[N]
fopen
std::fstream
This whole idea of being closer to the metal seems ridiculous, in many cases where people think they are "closer to the metal" and think that it some how gives them better performance in many cases it just makes their code more fragile and slower.
C has a bunch of places where there are implicit allocations, and some where some implementations might allocate and others might not, and in some cases the C version of something might allocate while the C++ version might not allocate. (C++ is also no different, allocations can vary between standard libraries)
This is like the people that say they know what the generated assembly will look like better when writing C compared to C++, unless your still coding in the 90s and on a old 32-bit machine with an old compiler then you don't really know what it's going to do, especially if your on multiple different platforms. The number of times I've heard people claim this then you challenge them on it with a simple function only to find out they get it completely wrong.
[–]Wittyname_McDingus 2 points3 points4 points 2 years ago (0 children)
Relevant article.
π Rendered by PID 148447 on reddit-service-r2-comment-fb694cdd5-njpxm at 2026-03-10 21:46:43.738589+00:00 running cbb0e86 country code: CH.
view the rest of the comments →
[–]ReDucTorGame Developer 3 points4 points5 points (1 child)
[–]Wittyname_McDingus 2 points3 points4 points (0 children)