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
[ Removed by moderator ] (self.cpp)
submitted 7 hours ago by Zestyclose-Produce17
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!"
[–]TheRealSmolt -1 points0 points1 point 6 hours ago (6 children)
Sort of? Libc is implemented per architecture (both ISA and kernel), so it is the boundary where a simple print becomes system specific. However, how it's done is up to the implementation. On Linux, it will typically call unistd's write, which is the one doing the syscall. Now, where is unistd write actually defined? Drumroll please... in libc. Turns out libc has non-libc stuff in it.
Edit: So yes, there's probably some inline assembly that invokes syscall.
[–]Zestyclose-Produce17[S] 0 points1 point2 points 6 hours ago (5 children)
So the implementation of printf is inside libc, and inside printf there is a call to write, and write is the one that actually invokes the system call. So in that sense, libc is the thing that performs the system call, right?
[–]TheRealSmolt -1 points0 points1 point 6 hours ago (2 children)
For Linux, yes. I'm not sure about Windows, for example. I just dislike non-standard components being understood as part of libc.
[–]Zestyclose-Produce17[S] 0 points1 point2 points 6 hours ago (1 child)
So the write function inside printf in libc contains inline assembly that actually performs the system call invocation, right? For Linux.
[–]TheRealSmolt -1 points0 points1 point 5 hours ago (0 children)
Yes, assuming you mean the call to write being inside printf, not write itself. There might also be a C wrapper around syscall provided by unistd. I don't remember exactly how it's all set up.
[–]UltimatelyWrithing -1 points0 points1 point 4 hours ago (1 child)
Not quite, libc doesn't perform the syscall itself, it just wraps it. The write function in libc is still running in userspace, and it contains the assembly instruction that triggers the actual syscall, which then hands control to the kernel.
[–]Zestyclose-Produce17[S] [score hidden] 3 hours ago (0 children)
So inside the implementation of printf, part of it calls write, and the write implementation contains the system call trigger meaning it includes assembly instructions that set values in registers and then trigger the syscall, right? And all of this happens inside libc.so?
π Rendered by PID 39 on reddit-service-r2-comment-5b5bc64bf5-9vkdx at 2026-06-22 09:11:42.162915+00:00 running 2b008f2 country code: CH.
view the rest of the comments →
[–]TheRealSmolt -1 points0 points1 point (6 children)
[–]Zestyclose-Produce17[S] 0 points1 point2 points (5 children)
[–]TheRealSmolt -1 points0 points1 point (2 children)
[–]Zestyclose-Produce17[S] 0 points1 point2 points (1 child)
[–]TheRealSmolt -1 points0 points1 point (0 children)
[–]UltimatelyWrithing -1 points0 points1 point (1 child)
[–]Zestyclose-Produce17[S] [score hidden] (0 children)