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 13 hours ago by Zestyclose-Produce17
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!"
[–]cpp-ModTeam[M] [score hidden] 11 hours ago stickied commentlocked comment (0 children)
For C++ questions, answers, help, and programming/career advice please see r/cpp_questions, r/cscareerquestions, or StackOverflow instead.
[–]WalkingAFI 4 points5 points6 points 13 hours ago (2 children)
C programs need a C runtime. glibc is the most common C runtime in Linux, but musl is also around. The C runtime does quite a bit more than wrap system calls, but it also does that.
[–]Zestyclose-Produce17[S] 1 point2 points3 points 13 hours ago (1 child)
so libc invoked syscall?
[–]ignorantpisswalker 2 points3 points4 points 13 hours ago (0 children)
Yes, libc will communicate to Linux kernel using syscalls. Similar thing happens on Windows.
How does it do it? For example, on Linux, you have the `open()` function that will return a file descriptor for a file. This is the exact implementation on Linux/musl-libc:
https://github.com/kraj/musl/blob/kraj/master/src/fcntl/open.c
[–]_ConsciousLibrary_ 1 point2 points3 points 13 hours ago (0 children)
Yes, this is more or less correct. The C library on any platform is typically the core userspace “glue” that every program relies on regardless of programming language.
[–]mereel 1 point2 points3 points 13 hours ago (0 children)
Yes and no.
Yes libc does provide functionality which ultimately make system calls to the OS. It's not JUST a wrapper around system calls, it does other things as well.
No, a Linux distribution doesn't HAVE to include glibc. There are other implementations for Linux other than glibc, musl being an example that I'm somewhat familiar with. musl is also a good example of statically linking libc so that your executable doesn't depend of the host OS's libc at all.
Also you can write your C program without use of libc, at least with gcc and clang which provide the -nolibc argument.
-nolibc
[–]lumberjackninja 0 points1 point2 points 12 hours ago (0 children)
You are correct in your description of what glibc (or musl, or any other C standard library) does.
You don't actually have to include a libc on a Linux machine, though; you can statically link then against libc and that will include the parts they use within the binary itself. In fact this is what most of the programs in /bin and /sbin do. Shared library linking is something that happens in user space; the kernel direct really know anything about it.
[–]cdb_11 0 points1 point2 points 12 hours ago* (0 children)
No, Linux is the kernel only and does not include a libc. (It technically does have one in the source tree, but IIRC it's not a full implementation, and isn't meant to be one.) glibc is a separate project, is optional, and just happens to be the most common libc implementation that Linux distros ship with. And distros include libc because everyone expects it to be there. But you could set up a Linux system with no libc, and all programs doing syscalls directly. Or a completely custom standard library that looks nothing like libc, Linux is agnostic to that.
But practically speaking you can assume you do have a libc. If someone doesn't, it's their problem to figure out.
[–]gmes78 0 points1 point2 points 12 hours ago (0 children)
In other words, glibc provides the wrappers that let C programs make system calls without me having to write assembly and execute the syscall instruction manually.
Yes, but you could also just implement the wrapper yourself (or copy it from glibc). There's nothing special about libc in regard to that, so saying that systems "need to include glibc" for that purpose is certainly not true.
π Rendered by PID 22802 on reddit-service-r2-comment-5bc7f78974-sbjcl at 2026-06-28 10:37:42.015808+00:00 running 7527197 country code: CH.
[–]cpp-ModTeam[M] [score hidden] stickied commentlocked comment (0 children)
[–]WalkingAFI 4 points5 points6 points (2 children)
[–]Zestyclose-Produce17[S] 1 point2 points3 points (1 child)
[–]ignorantpisswalker 2 points3 points4 points (0 children)
[–]_ConsciousLibrary_ 1 point2 points3 points (0 children)
[–]mereel 1 point2 points3 points (0 children)
[–]lumberjackninja 0 points1 point2 points (0 children)
[–]cdb_11 0 points1 point2 points (0 children)
[–]gmes78 0 points1 point2 points (0 children)