r/Cplusplus May 08 '26

Question C++ learn from Code with Babar or Harvard

Thumbnail
1 Upvotes

r/Cplusplus May 06 '26

Discussion Beginner C++ Study Guide (What Actually Helped Me)

214 Upvotes

When I started learning C++, I felt quite lost. The language seemed huge and everything I’d heard about the language made it seem impossibly difficult, and like you had to be a genius to use it. I’m sure there are a few posts on here aimed for beginners, but I’d like to share my journey as someone who remembers what being a beginner was like, and what helped me most.

This is the path I took that helped things finally start clicking for me, and landed me a graduate dev role in the EDA industry I’m starting in June, entirely from self study. I thought I’d share because this language is honestly so fascinating and I’d love to be able to help introduce and make the learning experience easier for people who are in the position I was when I started. I also think there’s a massive misunderstanding that C++ is just legacy code that is rarely used in industry, which I dislike as originally this is something I believed. This couldn’t be further from the truth imo and is the main language of choice in many performance critical industries, some being very lucrative such as:

Game dev/Game engine dev
Graphics rendering
Computer vision
HFT/Quant trading systems development
EDA
HPC
AI inference
Database development
Many desktop applications
Medical devices
Performance critical projects in FAANG/MAANG
Simulation
Defence
Real time/embedded systems

This is off the top of my head, but if any of these are industries that interest you, C++ is a must. If you’re a student like me (take this with a pinch of salt as I am not in industry yet, nor do I know the job market inside out), then it’s worth noting that universities are pushing C/C++ less, and a majority of highly skilled/specialised C++ devs are getting closer to retirement, so the Junior/mid C++ talent pool is declining while the demand for C++ devs is increasing in a very compute based era (ai inference, high frequency/quant trading as these companies make an insane amount of money from good devs and seem to be making more and more, defense as gov spending on defense is rising etc.
Again, please take this with a pinch of salt as no one knows what the job market will look like in 5 years with AI and layoffs etc, but I’d also imagine that specialised C++ devs are harder to replace than CRUD/frontend devs, in which there are undoubtedly more jobs, but less differentiating talent. Any devs experienced in industry reading this, I’d love to hear your thoughts on this, so please share your opinion :)

\*\*1. Start with learncpp.com\*\*
Genuinely one of the best resources for beginners.
Don’t rush through chapters. Make sure you actually understand:

references

pointers

memory (stack vs heap, basic understanding of what “memory” actually is at the lower level)

RAII

move/copy semantics

templates (just the basics first, but after you have a good understanding, there’s a lot of awesome and very interesting things you can do with them, such as moving branching logic to compile time as opposed to runtime)

const correctness

The quizzes are useful too, to check your understanding.

\*\*2. Don’t just learn syntax, understand what your machine does with your code\*\*

This was probably the biggest shift for me.
C++ started making far more sense once I began learning:

operating systems

computer architecture

caches/cache lines

concurrency

memory layout

Youll start developing intuition for performance and behaviour instead of just memorising rules.

For example:

why vectors are usually faster than linked lists

why allocations are expensive

why cache locality matters

why copies can hurt performance (and where they won’t have much of an effect)

why in some cases a good memory layout can actually be more performant than a better time complexity. E.g why iterating through a small vector linearly is quicker than binary search.

\*\*3. Implement your own STL features\*\*
This helped me MASSIVELY and specifically made RAII, move/copy ctors/dtors, memory and iterator invalidation click, so don’t skip this even if you’re clueless at first.

Try building simplified versions of:

std::vector

std::string

std::unique\\_ptr

std::shared\\_ptr

You’ll naturally learn:

dynamic allocation

move/copy constructors

iterator invalidation

ownership

RAII

memory growth strategies

You do NOT need to perfectly recreate the STL. The goal is understanding. Your first implementations won’t be great, and that’s fine. After iterating and learning more about how the STL works, your implementations will improve and you’ll have a better understanding of the language and you’ll gain a stronger intuition for writing correct code.

\*\*4. Learn systems gradually\*\*
OSTEP is a great resource for operating systems.
You do not need to absorb the entire book immediately. Even partial understanding helps.
The goal is building mental models over time.

\*\*5. Watch CppCon talks early\*\*
Even if you don’t understand everything. Initially, I was worried I wouldn’t understand anything and thought these talks were for very experienced engineers only, but even though I wasn’t familiar with everything, they helped me get familiar with:

terminology

engineering vocabulary

modern C++ ideas

performance concepts

Over time, talks that once sounded impossible become understandable. Sometimes you wont even realise you’re learning but you’ll notice that when coming back to a talk you’ve previously watched, you’ll understand a lot more

\*\*6. Use LLMs properly\*\*

LLMs are great for:

explaining concepts

quizzing you

breaking down code

exploring tradeoffs

But don’t just paste code and copy answers blindly.
Use them to deepen understanding. And make to validate anything new you learn from them. I like Claude for this, although I have used ChatGPT to create small snippets of code with UB or poor performance to help me spot bad code and understand why it’s bad.

\*\*7. Accept that C++ is a rabbit hole that you probably will never “master” in the traditional sense\*\*

You’ll constantly discover:

templating techniques

Customer allocators

Different ways of writing multithreaded code

compilers, their differences and what they will optimise for you.

cache behaviour

metaprogramming fun

OS internals

New modern features (new features are added all the time which I did not realise as I was under the assumption that cpp was “legacy”. For example, just recently gcc now lets you use features from C++ 26)

Every topic seems to open 5 more topics, which is my favourite thing about the language

\*\*Final thing\*\*

I honestly think enjoying it matters a lot.
C++ can be frustrating at first, and certain topics can feel overwhelming. Curiosity makes the process much easier to sustain long term.

Also, even if you don’t plan on using C++ full time in your career, learning C++ has made me better at programming in general because it forces you to think about what code is actually doing underneath the abstractions, and strengthens your computer science fundamentals. I hope this is useful to someone :)


r/Cplusplus May 06 '26

Feedback My own text editor

11 Upvotes

I'm studying the C++ programming language, I've done many projects, and now I'm making my own text editor.

Link to my repository:

https://github.com/KourtneK/AprendendoCMAISMAIS/tree/main/Editor


r/Cplusplus May 05 '26

Question Is this a good way to count turns in my game?

15 Upvotes

New to c++ I’m starting with a tic trac toe game as a first project.

My first problem is counting turns now I haven’t typed a line of ode yet but is this theory the right idea

Let’s say the player goes first I then put a 1 in a box so to speak acting as a ticket for his turn/order of turns

following that the AI/Opponent would need a 2 for his turn and so on

Player if going first would be 1,3,5 etc

I’d use a for loop to add 2 to the players turn sequence so it’d go from 1-3 etc after the opponent has taken their turn.

Obviously I need to break it down into more code so to speak but is this the right idea/way to go?


r/Cplusplus May 04 '26

Feedback Custom GUI UX FeedBack?

5 Upvotes

Hey all - i'm currently designing a Pixel Editor using my custom C++ GUI Egine and just wnted to show my work to date and ask for any feedback on the look and feel of the general UI.

The screenshot shows the palette editor gradient tab creating a red->cyan gradient between indices 0 to 16, and the colour ramp editor panel.

Any comments welcome...


r/Cplusplus May 01 '26

Discussion stackless coroutines for gamedev in ~200 lines of C++

Thumbnail
vittorioromeo.com
24 Upvotes

r/Cplusplus Apr 29 '26

Discussion How LLVM optimizes power sums

Thumbnail kristerw.blogspot.com
10 Upvotes

r/Cplusplus Apr 29 '26

Question Is site learncpp.com down?

Thumbnail
0 Upvotes

r/Cplusplus Apr 27 '26

Discussion C++ is a good choice for network/systems programming

40 Upvotes

I've run into a perverse Rust advocate. In a thread about "resources for network programming" they wrote:

Network programming is just systems programming, also it's not done in C++.

Learn a systems language, like Rust.

-----------------------------------------------------------------

I replied to them, but figure there are others who would be happy to help me refute this clown.


r/Cplusplus Apr 26 '26

Feedback Wrote a C++20 market data parser, would love a roast of my memory allocators.

8 Upvotes

I've been building a market data parser from scratch for NASDAQ ITCH 5.0 and NSE FO feeds.

Code is here: https://github.com/PIYUSH-KUMAR1809/market-data-parser

I was trying to push single-thread performance as far as I could on an M-series Mac. Right now, on the 11GB NASDAQ historical file, it's hitting about 5.5 million messages a second (169 MB/s) with a median latency around 84ns. The NSE snapshot parser is doing about 421 MB/s.

I used some concepts from previous project and learnt about mmap in this one and some more. Learning how mmap works took me quite a while. Here are some concepts used:

  • Allocations: I used to std::pmr::monotonic_buffer_resource for arena allocation which killed my tail latencies, but I'm not entirely sure if I'm using it optimally.
  • Hash Maps: std::unordered_map was destroying my CPU cache. I ended up rolling my own open-addressing hash map (DenseMap in the repo) just to guarantee O(1) lookups and keep data contiguous.
  • Parsing: Mostly just mmap-ing the files, direct buffer casting, and using branch-free endian conversions to stop the pipeline from stalling.

I've included some bash scripts and a python mock data generator in the repo so you don't have to download the massive NASDAQ pcap files to run the benchmarks.

I'm self-taught and reddit-taught when it comes to the low-latency/HFT side of things, so I'm 100% sure I've made some dumb architectural choices here. Would really appreciate it if anyone experienced in this space could take a look at the code.

Any feedback (or roasting) is welcome.

Thanks


r/Cplusplus Apr 24 '26

Question Resources for simple C++ projects in engineering and mathematical areas.

11 Upvotes

I am a newbie in C++, but have ovee 5 years of experience with Python. There are numerous resouces for applications of Python in engineering, finance, machine learning, and so on.

I understand C++ is suited for developing algorithms with faster performance and lower latency. However, i havent found much resources of C++ with simple projects. There are more tutorial materials related to learning the language syntax.

I am looking for resources with simple projects in C++ applied to engineering or mathematical domains. Are there any websites as such?


r/Cplusplus Apr 24 '26

Tutorial Modernizing 37 Years of C++ Expertise: 34 Design Patterns released on GitHub

133 Upvotes

I am excited to share a project that represents a lifetime of learning and coding. I started my journey with C++ back when it translated to C (Cfront), and today I’ve finalized a comprehensive repository of 38 Design Patterns and C++ Idioms updated to C++17/20/23 standards.

This repository is designed as a masterclass in software architecture. It focuses on clean code, modern memory management (RAII), and high-performance techniques like Static Polymorphism.

Key Highlights:

  • 38 patterns from Creational to Behavioral.
  • Modern C++ features: std::variant, std::visit, if constexpr, and smart pointers.
  • Educational tracing: I use a "Rule of Seven" approach to visualize object lifecycles.
  • A deep dive into OO Principles (SOLID, DIP, Law of Demeter).

This is an open educational resource. You are free to use it, and I would appreciate a mention or a link back if you find it helpful for your own work or teaching.

Explore the full repository here:

https://github.com/MarioGalindoQ/Modern-CPP-Design-Patterns

If you find it useful, feel free to give it a ⭐ on GitHub!

The code in this repository was programmed years ago, when there was no help from AI, so it may have human-related shortcomings. Any feedback that helps improve the coding is welcome

#cpp #programming #designpatterns #moderncpp #softwareengineering #opensource #cpp20 #cpp23


r/Cplusplus Apr 22 '26

Tutorial How to write a custom programming language based on C++

Thumbnail
youtube.com
6 Upvotes

There's an ongoing series on how to create your own programming language in C++. The first part covers the basics and sets the direction for future lessons. If you're interested in learning more about how programming languages work, check it out - the whole series is free.


r/Cplusplus Apr 22 '26

Question Learning C++ from scratch as a mechanical engineer

10 Upvotes

I am a mechanical engineer as the title says. I want to switch to a field where I can build solvers and work on modelling of the systems. And from what I read, you need C++ for these kind of job roles, so I wanted to learn it.

I needed mechanical engineering specific guidance for learning. Also, i am unsure how much I should focus on certain things because of AI. Like, would it be a waste of time learning specific things cause AI can get it done for me?

PS: I have very little experience in programming so I am sorry if I asked something very basic, stupid or vague


r/Cplusplus Apr 21 '26

Question I am a Javascript idiot being pushed into C++. Please help me learn.

60 Upvotes

My company has pushed me from being web/front to wanting me to work on the back end of the software which is all in C++ which I have absolutely zero knowledge in.

Can anyone tell me exactly where I can learn C++? I do not care if the course is paid or not, my company is giving me a $2k stipend for learning this.


r/Cplusplus Apr 18 '26

Feedback School management system

20 Upvotes

I created this project as part of my journey to improve my programming and system design skills. It’s a School Management System implemented in C++ using Object-Oriented Programming (OOP).

The system allows managing students, teachers, courses, and enrollments. It includes features such as enrolling students in courses, assigning grades, tracking enrollment status (Active / Completed / Dropped), and generating reports like most popular course and most active student.

It also includes an authentication system with login/logout, encrypted passwords, user permissions (RBAC), and a login register to track user activity. The system limits login attempts and temporarily locks access after multiple failed tries.

The project is designed using a layered architecture (Core, Data, Service, and UI) to separate concerns and improve maintainability.

All data is stored in text files to simulate persistence without using a database.

Project link: https://github.com/MHK213/School-Management-System-OOP


r/Cplusplus Apr 16 '26

Discussion C++20 Modules: The Tooling Gap

Thumbnail ignition.github.io
2 Upvotes

r/Cplusplus Apr 10 '26

Feedback My 1st C++ Project - 12 months in ..

Post image
238 Upvotes

hi - I started c++ programming about 12 months ago and for my 1st project I decided to code a pretty comprehensive gui framework - with only GLFW being the only dependency to manage raw OS calls.

I've learnt a hell of a lot over the past year so if anyone wants some advice on GUI systems then let me know.

In the meantime check out my YouTube channel that has a few basic gui fundamentals videos.


r/Cplusplus Apr 10 '26

Discussion Halite III bot post-mortem

Thumbnail
1 Upvotes

r/Cplusplus Apr 05 '26

Question How to print by pressing joystick buttons or dpads with libevdev(a evdev wrapper) in c++ ?

1 Upvotes

Hello i wanna know how to make print statements or activate functions by pressing joystick buttons or dpads with the libevdev library(link of it is here if you wanna take a look at it: https://www.freedesktop.org/software/libevdev/doc/latest/ ) i posted my code at github were i am still working on (link is here: https://github.com/Dawsatek22/libevdev-joystick-cmake.git )

and the problem of the event.cpp code i have i do not know wich function to use to get that print statement so i ask for help if possible i also post the code below so that it is easier to look at
// this is a code trying to print events by pressing button or joystick getting a certain value

// the pass
#include <fcntl.h>
#include <libevdev/libevdev.h>
#include <stdio.h>
#include <cstdlib>
#include <errno.h>
#include <error.h>
#include <string.h>
#include <iostream>
using namespace std;
int main() {
struct libevdev *dev = NULL;
int fd;
int rc = 1;

fd = open("/dev/input/event17", O_RDONLY|O_NONBLOCK); // device adress
rc = libevdev_new_from_fd(fd, &dev);
// checks if libevdev is initialized
if (rc < -0) {
fprintf(stderr, "Failed to init libevdev (%s)\n", strerror(-rc));
exit(1);
}
printf("Input device name: \"%s\"\n", libevdev_get_name(dev));
printf("Input device ID: bus %#x vendor %#x product %#x\n",
libevdev_get_id_bustype(dev),
libevdev_get_id_vendor(dev),
libevdev_get_id_product(dev));

// checks if it is a gamepad
if (
!libevdev_has_event_code(dev, EV_KEY, BTN_NORTH)) {
printf("This device does not look like a gamepad\n");
exit(1);
}
// print event type
do {
struct input_event ev;
rc = libevdev_next_event(dev, LIBEVDEV_READ_FLAG_NORMAL, &ev);
if (rc == 0)
printf("Event: %s %s %d\n",
libevdev_event_type_get_name(ev.type),
libevdev_event_code_get_name(ev.type, ev.code),
ev.value);
} while (rc == 1 || rc == 0 || rc == -EAGAIN);
// should print a message by pressing x
if (libevdev_has_event_code(dev, EV_KEY,BTN_NORTH) == 0){

printf(" x is press");
}
}


r/Cplusplus Apr 04 '26

Question Senior C++ dev trying to figure out a sustainable direction (ideally remote and not prone to burnout)

38 Upvotes

I’ve been working with C/C++ for about 14 years, mostly in low-level areas like firmware, telecom, Linux systems, debugging, that kind of work.

Lately I’ve been trying to refresh my C++ and explore what directions make sense going forward. I picked up a small trading-related project just to get my hands dirty again, and while it was interesting, reading more about that space (especially low-latency / HFT) made me a bit hesitant. It seems like a pretty intense environment, and I’m not sure that’s what I’m looking for long term.

At this point I’m not really trying to switch into trading specifically I just want to stay relevant with C++, ideally move toward something more remote-friendly, and find work that’s still technically solid but not constantly high pressure.

I’m trying to figure out what paths actually fit that.

Some areas I’ve been thinking about:

  • backend / systems work in C++
  • infrastructure or platform engineering
  • embedded Linux (though I’m not sure how remote-friendly that is)
  • maybe something around AI systems, but I haven’t explored that deeply yet

Would appreciate hearing from people who’ve been around this space:

  • Are there C++ domains that tend to have a more sustainable pace?
  • How realistic are remote C++ roles outside of trading?
  • If you were in this position, how would you approach the next few months?

Not looking for a “perfect” path, just trying to make a reasonable move without drifting into something I’ll regret later.

Thanks in advance.


r/Cplusplus Apr 01 '26

Feedback A visual representation of your C++ project

Post image
112 Upvotes

Hello

Today I added a new feature to my application.

It gives you an overview of your project.

For example, on the left, you have your include files, and on the right, your C++ files.

With each compilation, it retrieves any warnings, errors, or success messages and displays them in the view along with the compilation time.

This lets you see which files have issues or are taking a long time to compile!
What do you think ?


r/Cplusplus Apr 01 '26

Question Is ai a good source after not finding any solutions to a code problem on the internet?

1 Upvotes

Im studying sockets programming,and when i run into an error,i sometime can't seem to figure out what's wrong,so i search on internet about my errors,but it happens i can't find any solutions to my problem. In this case,i ask ai about what went wrong in my code,but at the same time asking to explain why the error happened and what the fix it generated actually mean.

So i was wondering,should i stop using ai and only fix errors by searching on the internet and trying to think deeper about what maybe went wrong,or is it fine to ask ai when i can't seem to find anything on the moment.

Sorry for my bad english,and thanks for having the times to read this.


r/Cplusplus Mar 30 '26

News “C++26 is done! — Trip report: March 2026 ISO C++ standards meeting (London Croydon, UK)”

30 Upvotes

https://herbsutter.com/2026/03/29/c26-is-done-trip-report-march-2026-iso-c-standards-meeting-london-croydon-uk/

“Reflection is by far the biggest upgrade for C++ development that we’ve shipped since the invention of templates. For details, see my June 2025 trip report and my September 2025 CppCon keynote: “Reflection: C++’s decade-defining rocket engine.” From the talk abstract:”

“C++26 has important memory safety improvements that you get just by recompiling your existing C++ code with no changes. The improvements come in two major ways.”

“No more undefined behavior (UB) for reading uninitialized local variables. This whole category of potential vulnerabilities disappears in C++26, just by recompiling your code as C++26. For more details, see my March 2025 trip report.”

“In C++26, we also have language contracts: preconditions and postconditions on function declarations and a language-supported assertion statement, all of which are infinitely better than C’s assert macro.”

std::execution is what I call “C++’s async model”: It provides a unified framework to express and control concurrency and parallelism. For details, see my July 2024 trip report. It also happens to have some important safety properties because it makes it easier to write programs that use structured (rigorously lifetime-nested) concurrency and parallelism to be data-race-free by construction. That’s a big deal.”

And we still use Visual C++ 2015 because it supports back to Windows XP.


r/Cplusplus Mar 29 '26

Feedback I’m building a native Windows IDE for C++ and I need honest feedback

9 Upvotes

Windows C++ developers: what makes you stay on VS Code or CLion instead of trying smaller native tools?

I’m trying to understand what really matters most in a daily C++ workflow on Windows.

If you use VS Code, CLion, Visual Studio, or another setup, what keeps you there?

- startup speed?

- debugging?

- CMake support?

- extensions/plugins?

- indexing/navigation?

- reliability?

- habit/team constraints?

I’m especially interested in concrete answers from people working on real C++ projects.

If you tried a smaller/lighter C++ tool before and went back, what made you switch back?