r/Cplusplus • u/Weird-Promotion3026 • 4h ago
r/Cplusplus • u/Salt_Character1791 • 7h ago
Discussion Title: FactSet Hyderabad – DevOps Engineer Interview Experience | What should I expect next?
reddit.comr/Cplusplus • u/Individual_Island_20 • 1d ago
Question Help with the next update for my C++ game Snow Grab!
Hey everyone! I made a new game called Snow Grab. I officially released a prototype — version 0.2. I've been working on this game for a really long time. Sometimes even when I find a bug, I just laugh at it because it's honestly pretty funny to me.
Just a quick note: the game is in Polish. Other languages aren't planned right now, though I might add them in later updates — no promises!
I'd love to encourage you to drop an idea in the comments. If you want to try it out, I can send you the link where you can download it. If you run into any issues downloading it, it's not a virus — it's just my game! I know most browsers or Windows might pop up a virus warning for small indie .exe files, so if needed, I can show you how to download and run it safely.
I'd really like to hear your suggestions. Right now I can't add super complex things like real-money systems because that's still tough for me to do in C++, and I prefer figuring things out myself rather than relying on AI to write everything for me. You don't even have to play the game — the most important thing for me is just getting your ideas!
The game works by typing option numbers — for example, option 1 is digging snow, where you collect snow and buy upgrades. You could suggest something like adding a shovel that can be upgraded multiple times. I'll gladly take ideas like that and reply to let you know if your idea will be added to the game or not.
Thanks in advance for every single idea if anyone drops one!
Game -> Snow Grab 0.2r by Added
r/Cplusplus • u/AstraVo1d • 1d ago
Question What is the fastest & Best way to make GUI with C++ / and supporting AR/EN
if anyone could help me to figure out what is the best library on C++ that could be fast & supporting Arabic and English , type your comment !
r/Cplusplus • u/Iamspyder0 • 1d ago
Question Best c++ books for both competitive programing and first time learning
reddit.comr/Cplusplus • u/Adventurous-Heart381 • 1d ago
Question Help me please
Hey guys, I have a DSA exam in about 4 hours and I’ve just started studying because I’ve been ill. The topics are mostly beginner friendly (bubble sort, quick sort, merge sort etc) what’s the most efficient way to study in order to pass?
r/Cplusplus • u/matanl99 • 1d ago
Feedback Pork: an experimental verifyer for C++
Hello,
I have been experimenting with building a formal verifyer in C++.
It is called Pork and you can find it here: https://github.com/matanl99/pork-cpp-verifier
The verifyer is influenced by Ada/SPARK and has three levels:
Stone: Checks for life times, initialization, side effects, aliasing and more.
Bronze: Checks data flow dependencies. Which inputs may the output depend on.
Silver: Used CBMC and ESBMC to check for division by zero, signed overflow, out of bounds.
They are cumulative Stone Bronze Silver.
This tool can be used by you, the programmer, or by an AI agent, to get feedback if the function you wrote passes the different levels. This should bring you some kind of guarantee in the future.
Example:
int add(int a, int b) {
return a + b;
}
int ratio(int x, int log_level) {
PORK_PRE(x > 0);
PORK_DEPENDS_RESULT(x);
return 100 / x;
}Pork would classify them:
add as stone
ratio as bronze
And if you tell Pork to check for silver then only ratio would be classed as silver because the function add has a+b that can overflow.
So in the future it would be very nice if silver means that the function CANNOT FAIL during runtime.
It is still very experimental but please leave feedback.
Regards,
Mathias
r/Cplusplus • u/Vousch • 2d ago
Feedback Looking for feedback on my C++17 networking library for multiplayer games
r/Cplusplus • u/Vousch • 2d ago
Discussion I migrated my C++ networking library from C++26 modules to C++17. Here's what changed.
I've been developing LightnerX, a networking library built around GameNetworkingSockets and an authoritative client-server communication model.
The first public beta used C++26 modules. I wanted to experiment with modern C++, but I eventually realized that requiring such a recent toolchain was limiting who could actually use the library.
So for v0.2.0-beta, I migrated the project to C++17.
This involved more than replacing import with #include.
I had to reorganize 14 module units into headers and implementation files, replace newer standard library features, adapt the public API, and ensure shared state behaved correctly across translation units.
The current API uses std::string_view for binary views and lightnerx::Result for error handling.
To check whether the migration preserved behavior, I used differential tests against the original C++26 implementation and cross-version UDP integration tests.
The new version also includes additional fixes for networking lifecycle and resource ownership issues.
One thing I've learned from this project is that using the newest language features isn't always the best decision for a reusable library.
I'm curious how other C++ library maintainers approach this. How do you decide which language standard to target?
r/Cplusplus • u/Small-Dig-8233 • 3d ago
Feedback first time making a calculator thingy but in QT am i doing it right? i think the logic is janky and since it works i don't even touch it
r/Cplusplus • u/dEvator8085 • 3d ago
Feedback I built a Lightroom inspired, a non-destructive photo editor in C++ 23.
What started as a small example project for my C++ UI library,
LiteUI : https://github.com/IAmTheFool/liteui, has grown into its own standalone application, so I decided to give it a separate repository. The goal was to build a Lightroom-inspired photo editor with a native desktop experience, using a shared codebase for Windows and Linux.
GitHub: https://github.com/IAmTheFool/literoom
I'd appreciate feedback from the C++ community, particularly on the architecture, image-processing pipeline, API design, performance and overall implementation.
It's still an ongoing project, and I'm interested in hearing what you think.
r/Cplusplus • u/Heavy-Imagination525 • 3d ago
Question Problem in running C++ codes
So i recently purchased a new laptop and when i try running the C++ code sometimes even if my code is correct the vscode doesnt execute the code.
Then I sent the screenshot to chatgpt and it said my code is correct some feature called
WINDOWS SMART APP CONTROL might be preventing it from executing the code .
But once I turn it off i can't turn it on again so what should i do??
r/Cplusplus • u/Any_Wait_7309 • 3d ago
Question Signed left shift causes overflow, and therefore undefined behavior
I was solving a question on Leetcode: Reversing Bits
The goal is simple, that we have been given an positive even number and we are supposed to reverse it's binary representation.
If we notice, it says "even" number - that implies the LSB is set to 0 and when we reverse the binary representation the 0 would move to MSB
I thought, it would be great to reverse it with just "bit manipulation" which is as folllows:
```cpp
n = ((n >> 1) & 0x55555555) | ((n & 0x55555555) << 1);
n = ((n >> 2) & 0x33333333) | ((n & 0x33333333) << 2);
n = ((n >> 4) & 0x0F0F0F0F) | ((n & 0x0F0F0F0F) << 4);
n = ((n >> 8) & 0x00FF00FF) | ((n & 0x00FF00FF) << 8);
n = (n >> 16) | (n << 16);```
Instead of reversing the number, we swap 2 bits, then 4 bits, then 8 bits and then 16 bits. The resultant sequence is exactly the reverse of the original binary representation.
Now, the incoming number is a signed int meaning it has range from:
```cpp
-2,147,483,648 to 2,147,483,647
-2^(31) to 2^(31) - 1
10000000 00000000 00000000 00000000 to 01111111 11111111 11111111 11111111
```
My perspective is that: Just shifting things around isn't really going to make it overflow, since it's a signed int - all that's gonna happen is the result will be interpreted in a wrong manner.
Example: Take the INT_MIN and << 1, what happens? Mathematically it should produce a smaller number that falls outside of the range of INT_MIN, but in computers the 1 is just discarded and we are left with a value of 0
Example: Take the INT_MAX and << 1, what happens? It turns into a negative number, because we are using signed int, does it over flow? not really.
I had initially used int for this and it produced wrong values because the reversed final value would be read as int, so i started casting int to uint and worked with it. Which internally should only work with positive numbers and correct binary representation and it worked.
Where it got weird was - I asked chatGPT to see if my logic is sound and it said that without the cast the number would just overflow in a signed int. From what I understand that's not really possible, because we are just shifting things around and even if we set the MSB to 1 ( for largest possible positive number ) it's just gonna get interpreted as a negative number.
Verdict: It won't overflow
But then it says that the representation is not an issue, it's c++ standard and due to that it may produce an undefined value - basically, in our first example it won't allow wrapping because mathematically it doesn't make sense. But it works!
At this point, i am 100% sure that it's wrong, it's just not possible to overflow the signed int through this algorithm, it makes sense to use uint because it would maintain proper representation internally and then finally when we cast it back to int - we would get the correct representation in signed format. It's only possible to overflow if we were working with decimal values.
I would say that even if the input was an odd number, still there wouldn't be any overflow just wrong representation!
TLDR: Don't sideline me for using AI, i just used it to summarize and verify my understanding. I think that it's wrong according to the current standards and undefined behavior or overflowing isn't really any issue. Just that the results will be wrong because it would be interpreted wrong.
The same would apply to even if the incoming number was negative or odd or completely positive (uint)
Thoughts?! What am I missing like would it really overflow?
r/Cplusplus • u/Select_Transition287 • 3d ago
Discussion Exp. C++ Dev - Getting started with multithreading ?
reddit.comr/Cplusplus • u/Livid_Island_5107 • 5d ago
Question IDE suggestions
I have just started learning C++ from a background in Python, but I don't know many C++ IDEs. What is a good C++ IDE (ideally online but that isn't a requirement) with a built in compiler. If it doesn't have a compiler, what is a good compiler to use with it.
r/Cplusplus • u/PeterBrobby • 5d ago
Tutorial Physics Programming Part 5: Spring Physics
I explain the mathematics underpinning spring mechanics then implement a solution in C++ using a net as an example. Implementation begins at 10:05. Feedback is welcome.
r/Cplusplus • u/Serious-Republic5503 • 5d ago
Question Raylib help
I can’t add images in raylib even tho I’ve tried everything I’m a beginner and my teacher told us to make a game and I want to add music and some pictures. Please help
r/Cplusplus • u/lawless_abby • 5d ago
Discussion A Cargo-like custom build system wrapping CMake for linux system programmers

I am working on a custom build system named Redline which is like Cargo of Rust.
This is actually a wrapper and the real build system is still CMake so that the cpp programmers who have been using and learning CMake can work with it easily.
Features:
redline rev: scaffolds a project (src/main.cpp,redline.toml,CMakeLists.txt, git init)redline run [--release]: builds with CMake + Ninja and runs, with separate dev/release profiles (dev has ASan/UBSan on by default)redline run --gdb | --valgrind | --perf --flame: debugging and profiling without hand-assembling the flagsredline doctor: checks for cmake, ninja, gdb, valgrind, perf and a flamegraph renderer, and offers to install what’s missingredline add/redline test: FetchContent dependencies and Catch2 testsredline todo: lists TODO/FIXME comments across your coderedline man: a local man-page-style C++ feature reference (C++11 to 23) in the browser (my personal favourite)
The generated CMakeLists.txt stays fully hand-editable. Redline only touches the managed block between its markers, and everything outside it is yours.
It’s written in Go. I might do a C++ rewrite in the future, but it’s not planned for now.
I used AI assistance while building this.
A short demo video is attached (doctor, rev, run --release, man).
I’d really appreciate reviews on the design, the UX, and anything that feels off or missing. Feedback and issues are welcome.
GitHub: repo
r/Cplusplus • u/Vousch • 5d ago
Feedback I migrated my C++26 networking library to C++17 to make it easier to integrate into existing projects
I've been developing LightnerX, an open-source C++ networking library for multiplayer games.
I originally wrote it using C++26 modules. I liked the idea of building a new project with modern C++ features, and since I controlled the development environment, compatibility wasn't initially a major concern.
But eventually I realized that requiring C++26 for a networking library was probably limiting its usefulness.
So I decided to migrate the entire library to C++17.
This involved more than changing the language standard in CMake:
Replacing C++ modules with conventional .hpp and .cpp files.
Removing dependencies on newer language and standard library features.
Implementing C++17-compatible alternatives to std::span and std::expected.
Updating the build configuration.
Testing the implementation against the original behavior to detect regressions.
One of my biggest concerns was preserving the existing API and functionality during the migration.
LightnerX uses Valve's GameNetworkingSockets as its transport layer and provides:
Client/server networking.
Connection management.
Message batching.
Single, group, and broadcast delivery.
Message interpretation and callbacks.
INER, my own communication protocol for authoritative client-server interactions.
During testing, I also used differential test fixtures to compare the migrated implementation against recorded behavior from the original version.
One fixture included 13,275 parsing invocations and 1,897 delivered messages.
The project is now available as a C++17 library, and I'm continuing to improve its tests, documentation, and examples.
GitHub: https://github.com/pietroth/LightnerX
I'd appreciate feedback from developers who have experience maintaining reusable C++ libraries.
Would you have chosen C++17 as the minimum standard for a project like this, or would C++20 be a better compromise between compatibility and modern language features?
r/Cplusplus • u/That-Subject7362 • 5d ago
Homework Give me toughes task do in c++
I got addicted to porn so I want to move myself from that
So give me the toughest programming or building things
It makes me busy
r/Cplusplus • u/naharashu • 5d ago
Question Is there any other compiler backend other than LLVM, MLIR?
reddit.comr/Cplusplus • u/Individual_Island_20 • 5d ago
Question What game should I make in C++?
My post with everyone's stories got a bit of traction—not huge, but a few people shared their experiences, and now I want to ask you: what game should I make?
It won't be a 3D game, more of a text/command game where you type something in and things happen. When it's ready, I'll put it on itch.io so you can test it out and drop a link here.
Feel free to suggest ideas and game names! You can even build off each other—for example, one comment can suggest a name, and another comment can suggest how the gameplay works. I'll check out every suggestion.
Instead of clicking buttons or UI, I'd rather have the player type a word or a couple of words—like typing
dig(or a command like that) and having something happen in the game.I'll look through all the ideas, and whichever suggestion gets the most upvotes will be the one I go with. I'll start building it tomorrow! r/cpp r/gamedev r/textgames r/roguelikedev r/learnprogramming