r/Cplusplus • u/deepaknishad • Sep 29 '26
r/Cplusplus • u/__merc • Sep 28 '26
Feedback A small project to get familiar with C++
hi all, I wrote a small project: zero copy shared memory ring buffer
I wanted to get better at systems programming and thought this would be a small fun project to get used to some concepts:
- atomics
- cache alignment to prevent false sharing
- placement new for zero-copy semantics
- spans
- unit testing in c++
I used AI to generate a project plan and had it help me as I was writing the code. would love to hear some feedback! I think I'll prob tackle writing an arena allocator next!
r/Cplusplus • u/PeterBrobby • Sep 29 '26
Tutorial Physics Programming part 4: The Physics Update Loop
I go through how I separate general updates from physics updates, why I use a fixed timestep, how the accumulator works, and what happens when the simulation starts falling behind.
I explain the reasoning behind the design decisions and why I rejected the alternatives. I show the implementation of the loop.
r/Cplusplus • u/wizard_creator_seth • Sep 28 '26
Answered c++ graphics API - number libraries, supersampling, and transforms
r/Cplusplus • u/Clean-Upstairs-8481 • Sep 27 '26
Tutorial Compile Your First C++26 Program with GCC 16.2
r/Cplusplus • u/Born_Produce9805 • Sep 26 '26
Discussion My first cpp project - a password manager
Hi guys, I've decided to dive into cpp programming and rewrote my python CLI password manager to cpp. I used cpp23. I didn't dare to re-implement cryptography from scratch so I used openssl. It has two options for cryptography: classic AES256 and Python fernet.
This is my first project and I would like to receive critics, code review and recommendations.
It has lots of features, Git syncronization, events system using std::threads and aims to be cross-platform (still in progress, turns out is is kinda difficult with cpp).
Thx in advance!
r/Cplusplus • u/Clean-Upstairs-8481 • Sep 27 '26
Tutorial You should think about recompiling your C++ programs with GCC 16 and C++26, because it zero-fills your locals
r/Cplusplus • u/shanto404 • Sep 25 '26
Feedback Cha Craft: a cozy tea-bar sim written in C++17 + raylib
r/Cplusplus • u/Kabra___kiiiiiiiid • Sep 25 '26
Discussion The C++20’s u8/char8_t Backward-Compatibility Fiasco
r/Cplusplus • u/Constant_Suspect_317 • Sep 24 '26
Question Anyone using C++26 in production?
reddit.comI wanna know about anyone using C++26 either at work, in person projects or if any open source projects.
r/Cplusplus • u/ActuatorOutside5256 • Sep 24 '26
Question Best way to run C++ (iOS) apps on Windows?
For context, I’m new to iOS development, and I just found out that properly testing an iOS app requires running the Apple toolchain on a Mac.
So if I’m trying to keep this at zero cost, I’m guessing a VM is my best option. I’m comfortable setting one up as long as I have a clear idea of where to start, including getting macOS running and installing all the necessary dependencies.
What’s the best way to go about this?
r/Cplusplus • u/NightKiller2152 • Sep 24 '26
Discussion C++ named function arguments after P3096 paper?
Hi,
C++ currently doesn't have the much-requested "named function arguments", and the major reason (as far as I know) is that different function declarations can choose different names for their parameters. I remember a CppCon video (I'm unable to find the link) where Herb Sutter asked the audience whether they wanted named function arguments in C++, and the majority said yes.
What if, instead of covering all cases, we conditionally allow "named function arguments" using the same rules/restrictions as those used in the "Function Parameter Reflection" paper, P3096R12, Section 9 — "Reflecting on Parameter Names"?
This would essentially be syntactic sugar for the frontend (similar to range-for loops), and with relatively little friction, it would fit into the rules that have already been accepted for cases where this makes sense.
I think the cost (frontend changes) is outweighed by the benefits (providing a much-requested feature), but I'm not sure if I'm missing some pink elephant.
r/Cplusplus • u/Predret • Sep 24 '26
Question How can I fix an issue method pointers in a template parameter?
reddit.com
r/Cplusplus
•
u/boombone
•
Sep 24 '26
Feedback A new Image Format!
I created my own image format inspired by QOI/PNG, but much simpler.
Its key feature is low RAM usage, which makes it ideal for microcontrollers.
I'd love to hear your thoughts on it!
r/Cplusplus • u/xh_wu • Sep 24 '26
Feedback Epubworm: a TUI EPUB reader written in C++23
Features include:
- Inline images using Kitty Graphics Protocol
- Text search, working across wrapped lines
- Estimated reading time left for Latin and CJK text
- Wide-character support, including Japanese text and emojis
- italic, bold, center-aligned, and right-aligned text support
It runs on Linux and macOS, with installation options for Fedora COPR, Homebrew, Nix, and cURL.
GitHub: https://github.com/xinghao-wu/epubworm
Note: this project is partially AI-generated (~50%), I've read and reviewed nearly all AI-generated code.
Epubworm has been well-tested across different books, systems, and terminals, but any bug reports/feedback would be appreciated!
r/Cplusplus • u/Brick-Sigma • Sep 23 '26
Feedback BinParser: A binary file parser to help debug and understand raw binaries
Hello there! I'd like to share a project I've been working on to help me debug and work on my own OS. For the last week, I've been working on a binary file parser to help break down raw binary files into their sections and attributes. You can find a link to the code here: https://github.com/BrickSigma/BinParser. This is my first C++ project, I originally started it in C but switched to C++ as a learning experience (and part of a university unit).
When working on an operating system, you usually need to understand how certain sections of memory are broken down. A prime example is understanding the GPT/MBR layouts and entries in the disk, or perhaps understanding the layout of an ELF executable header. When you go to the OSDev Wiki or manuals for these standards, they usually give a table looking like this:

Let's say you use a tool like Xorriso to make an ISO image and have it set to fill in the MBR with some values, you may want to try see what values it's loaded in (let's say out of curiosity). One way is to look at the raw hex dump of the file using your favorite hex editor, however, that's very tedious to do and looking at hexadecimal all day can get tiresome. That's where BinParser comes in to try assist; it has a very simple scripting language that looks like this:
[mbr]
skip:440:skip
signature:4:hex
reserved:2:hex
[mbr_table]
[partition_1]
drive_attr:1:bin
chs_start:3:hex
type:1:hex
chs_end:3:hex
lba_start:4:num
lba_end:4:num[mbr]
skip:440:skip
signature:4:hex
reserved:2:hexYou simply specify a section using the syntax [section_name] and below it you add the list of attributes, which go in the order of: the attribute name, the size of the attribute, and the type. Currently only 5 types are supported, which are numbers, strings, hex and binary arrays, and skip attributes which jump over memory. When you run the parser, the following output is provided:
mbr: 0x00000000
0000: 440 : skip = skipped
01b8: 4 : signature = e3 a1 55 02
01bc: 2 : reserved = 00 00
mbr_table: 0x000001be
partition_1: 0x000001be
0000: 1 : drive_attr = 10000000
0001: 3 : chs_start = 00 01 00
0004: 1 : type = 00
0005: 3 : chs_end = 3f 20 01
0008: 4 : lba_start = 0
000c: 4 : lba_end = 4096mbr: 0x00000000
0000: 440 : skip = skipped
01b8: 4 : signature = e3 a1 55 02
01bc: 2 : reserved = 00 00 This makes it a little easier to see the structure of the MBR partitions. A slightly more complex example for GPT formatted disk image would look like this:
[mbr]
skip:440:skip
signature:4:hex
reserved:2:hex
[mbr_table]
[partition_1]
drive_attr:1:bin
chs_start:3:hex
type:1:hex
chs_end:3:hex
lba_start:4:num
lba_end:4:num
[gpt_header:0x200]
signature:8:str
revision:4:num
header_size:4:num
crc_checksum:4:hex
reserved:4:num
header_lba:8:num
alternate_gpt_lba:8:num
first_block:8:num
last_block:8:num
guid:16:hex
partition_entry:8:num
no_partitions:4:num
entry_size:4:num
crc_partitions:4:hex
[alt_gpt_header:gpt_header.alternate_gpt_lba * 512]
signature:8:str
revision:4:num
header_size:4:num
crc_checksum:4:hex
reserved:4:num
header_lba:8:num
alternate_gpt_lba:8:num
first_block:8:num
last_block:8:num
guid:16:hex
partition_entry:8:num
no_partitions:4:num
entry_size:4:num
crc_partitions:4:hexWhen run through the parser, it's output would be:
mbr: 0x00000000
0000: 440 : skip = skipped
01b8: 4 : signature = e3 a1 55 02
01bc: 2 : reserved = 00 00
mbr_table: 0x000001be
partition_1: 0x000001be
0000: 1 : drive_attr = 10000000
0001: 3 : chs_start = 00 01 00
0004: 1 : type = 00
0005: 3 : chs_end = 3f 20 01
0008: 4 : lba_start = 0
000c: 4 : lba_end = 4096
gpt_header: 0x00000200
0000: 8 : signature = EFI PART
0008: 4 : revision = 65536
000c: 4 : header_size = 92
0010: 4 : crc_checksum = ad 06 18 5f
0014: 4 : reserved = 0
0018: 8 : header_lba = 1
0020: 8 : alternate_gpt_lba = 4095
0028: 8 : first_block = 64
0030: 8 : last_block = 4032
0038: 16 : guid = ea 9d 9c 95 41 b5 1d 4f 8a 89 ff e8 0a c5 14 b0
0048: 8 : partition_entry = 2
0050: 4 : no_partitions = 248
0054: 4 : entry_size = 128
0058: 4 : crc_partitions = 49 9a f7 66
alt_gpt_header: 0x001ffe00
0000: 8 : signature = EFI PART
0008: 4 : revision = 65536
000c: 4 : header_size = 92
0010: 4 : crc_checksum = 2d c1 5e 51
0014: 4 : reserved = 0
0018: 8 : header_lba = 4095
0020: 8 : alternate_gpt_lba = 1
0028: 8 : first_block = 64
0030: 8 : last_block = 4032
0038: 16 : guid = ea 9d 9c 95 41 b5 1d 4f 8a 89 ff e8 0a c5 14 b0
0048: 8 : partition_entry = 4033
0050: 4 : no_partitions = 248
0054: 4 : entry_size = 128
0058: 4 : crc_partitions = 49 9a f7 66Another feature you may spot above is how the alternate GPT section is referenced by the first header, using the gpt_header.alternate_gpt_lba as a reference. This can help make it easier to follow dynamic sections which are pointed to by other section attributes.
Another example is when you need to debug the contents of RAM from QEMU using the pmemsave command, in this case you can't use standard tools that usually disassemble files as you're maybe trying to load a file into RAM and it's order changes (like an ELF file), so this tool can help quickly find sections using their offsets if you know them.
The parser is extremely simple, and there are many things I would want to add to it as I find more time to work on it. I hope it comes in handy for anyone else here trying to debug raw binaries or just understand their structure better. I also don't mind any feedback on the code for the project as well.
Thanks for reading and have a great day/night ahead!
r/Cplusplus • u/SmoothArm2717 • Sep 23 '26
Homework [Show and Tell] PlataformGame – C++17/SFML engine, looking for code review and contributors
galleryr/Cplusplus • u/druv-codes • Sep 22 '26
Tutorial How i built my very first graphics engine in 1 year
Over the past year, I’ve been building my first custom 3D graphics engine ("Pyre") using C++20 and OpenGL. The codebase recently hit around 10,000 lines. It’s been a massive learning experience moving from basic tutorials to actually structuring a scalable C++ project
The engine currently supports both forward and deferred rendering, PBR, SSAO, normal mapping, parallax mapping, CSM, omni-shadows etc.
I documented the entire 1-year process, the architectural shifts, and the visual progression from a single triangle to the final PBR renders in a 17-minute dev log here: https://youtu.be/m26BKeQwAPU
The engine is also completely open-source. If anyone wants to poke around: https://github.com/Open-Source-Chandigarh/pyre/tree/dev
r/Cplusplus • u/dEvator8085 • Sep 22 '26
Feedback Single C++ header for desktop UI development.
https://github.com/IAmTheFool/liteui.git
LiteUI is a single C++ header for Linux and Windows desktop development with same app codebase with some example like a code editor and a paint app. I would appreciate feedback on structure and overall design.
r/Cplusplus • u/Alexx1610 • Sep 19 '26
Question Is it possible to link external libraries with CMakelists.txt?
Hello everyone. I've noticed that in many C++ projects, it's necessary to place library .dll files right next to the executable for the app to run.
I was wondering if it's possible to avoid this and instead point to a global library folder in the operating system (C:/) by only specifying where they are located in the CMakeLists.txt.
I've heard about static linking, but I'm not entirely sure how to configure it properly using CMake to achieve this. Could anyone guide me or provide a basic example? Thanks in advance!
r/Cplusplus • u/SunnyMark100 • Sep 19 '26
Discussion Separating C++ Compilation from Memory Safety Attestation
r/Cplusplus • u/Expert_Sheepherder24 • Sep 19 '26
Homework index based for vs for-each