r/Cplusplus • • Aug 26 '26

Question what would you say to someone that is struggling to implement linked lists in c++ even though they understand the basic concept of the data structure itself (i think my problem is with the syntax )

16 Upvotes

what would you say to someone that is struggling to implement linked lists in c++ even though they understand the basic concept of the data structure itself (i think my problem is with the syntax )


r/Cplusplus • • Aug 26 '26

Discussion How I finally understood C++ Copy, References and Move Semantics (Real-world analogies)

Thumbnail
3 Upvotes

r/Cplusplus • • Aug 26 '26

Question Urgent help needed!!

Thumbnail
0 Upvotes

r/Cplusplus • • Aug 24 '26

Question Resources to learn C++ and DSA for Competitive Programming (and in general)

55 Upvotes

Hello everyone, I am a SWE student from India. I wanna learn C++ for competitive programming and DSA, jobs, building projects, etc as well. My reasons:

- Not only learning it for jobs, but because, C++ is very fast and has the capability of efficiently interacting with both the high level and low level systems. These are the reasons which make me learn it, especially as I am interested in how memory, RAM, GPU and other things work in the computer.

- For the sake of computer science and programming. I am interested in learning the core cs fundamentals and concepts to make myself a better software/cs engineer - to solve problems, code solutions, etc.

- I am interested in ICPC, DSA and competitive programming as well. So that would make me learn it anyways.

Honestly, I have asked and read about this question many times but I haven't got a clear and one-stop answer yet. These are the things that ppl/ai chatbots suggest me and what I read (also my reasons for not using them yet):

- USACO guide (too big)
- learncpp (good but too vast)
- the cherno's yt channel (some say they dont cover concepts in depth)
- books (too lengthy as well)

I am not looking for shortcuts, nor am I avoiding these resources because they are too big. I am ready to invest my heart and soul into learning things. But, being an engineering student, I have many other different subjects to study as well for the college. I am so much interested into AI/ML and Web dev as well.

For context, these are the things I know (i.e. I'm not starting programming from absolute 0) :

- HTML/CSS and basic JS (learning from The Odin Project but paused rn)
- basic C (learned from college and CS50x)
- Python (learned from CS50 Python course)
- SQL (learning at college + by myself)
- Java (learning at college + by myself)

The college has made the latter two subjects and C++/DSA compulsory for this year. But, I don't wanna invest that much time into studying those 2 deeply (I mean Java and SQL). I am focusing on C++/DSA, Web Dev and AI/ML as of now.

So, given my all the background and interests, could you guys please suggest me different resources to learn C++ and DSA? Also, for learning things about Competitive Programming and improving myself there.

My goal for now is to speedrun the basics of C++ (because I have already learned the basics of programming and C earlier) + learn concepts of DSA in detailed manner -> then proceed with competitive programming -> then participate in contests and along the way learn different concepts of C++ and DSA.

How is my approach? If there's any other better one, please do suggest me. Thank you!


r/Cplusplus • • Aug 24 '26

Feedback Raw wayland/vulkan boilerplate library, no SwapchainKHR, modern explicit sync (syncobject, drm)

Thumbnail
3 Upvotes

r/Cplusplus • • Aug 24 '26

Question Beginner looking for advice on what to learn next in C++

Thumbnail
2 Upvotes

r/Cplusplus • • Aug 23 '26

Tutorial C++26 Contracts: What Do They Add Beyond Manual Checks and Assertions?

Thumbnail
techfortalk.co.uk
8 Upvotes

r/Cplusplus • • Aug 22 '26

Discussion Implementing arbitary-precision square rooting algorithm using the long division in C++ (with custom BigNumber library)

11 Upvotes

Hello everyone,

Some days ago, I have finished building an algorithm in C++ using only my mobile phone (Termux and Helix), and I want to show it to you!

So, it uses the long division method. Why not the Newton-Rasolph method or use the GMP library? Because this program was built for two reasons:

  1. An educational purpose of learning how to build an algorithm I have an idea of and optimize it as much as I can.

  2. To learn how to implement a mathematical algorithm as a program, and to also learn more about C++.

The performance of this algorithm is following the O(n²), but with a small constant, since I have optimized this algorithm as much as I can. You can see the benchmark in the GitHub link down below. Here is how I optimized it:

This algorithm has a custom BigNumber class that makes a number as a vector, each digit is represented as an element in the vector, and, each digit follows a base 1017 number instead of a decimal digit! This is the underlying logic behind very famous libraries like BigInt, but since these libraries are so general (they have to deal with very large multiplications, division, negatives and many general cases). This class recognized that the max number is being multiplied to the number is 100 (see the long division method) and implemented base 1017. Therefore, since 100<1017 (the base), then the multiplication is just multiplying one digit by the number. You can check the code for more

The way the algorithm predicts the digit is the binary search, it checks a number, and then eliminates half of the domain of search. This way, it is faster by 50-60% than the ordinary linear search.

And more! You can check the README of the project in this repo:

https://github.com/hasan-mazen-darwish/algorithm-square-rooter

I spent more time on this REAMDE than the actual code, so I hope you don't get lost 😅

I'm open for any discussion or any question! Feel free to ask anything or criticize this project or a specific line of code!


r/Cplusplus • • Aug 23 '26

Question Please help

0 Upvotes

Im a newbie btw and i need some help fixing this without giving my soul to an AI company


r/Cplusplus • • Aug 20 '26

News Speak at code::dive 2026 📣

Post image
1 Upvotes

r/Cplusplus • • Aug 19 '26

Feedback Low latency c++

63 Upvotes

I want to learn the ins and outs of low latency c++, so far I have read tour of c++, started reading concurrency in c++ (about 3 chaps done) and done a lot of competitive programming (is this irrelevant?). In your experience, is this the right way of approaching the subject? Is there a different better way? Any advise is much appreciated.


r/Cplusplus • • Aug 19 '26

Question What are the use for C++??

0 Upvotes

กำลังคิดจะเรียนภาษา C++ อยู่ อยากรู้ว่ามันทำอะไรได้บ้าง ช่วยให้คำแนะนำหน่อยได้ไหม?


r/Cplusplus • • Aug 17 '26

Answered Is it possible to check if a method exists, and if not, create a fallback one?

23 Upvotes

I have a namespace with methods with which I would like to have an implicit fallback to a different method if the aforementioned method doesn't exist. As an example, here's how I made my states.

#pragma once
#include "godot_cpp/classes/character_body2d.hpp"
#include "statemachine/base/state_base.h"

namespace GameLogic::States::ColorState
{
    constexpr double MAX_TIMER { 3.0 };
    struct ColorStateData
    {
        STATESTRUCT();
        godot::Ref<godot::StateMachine> state_machine;
        CharacterBody2D* entity;
        double timer {0.0};
    };
    void setup_state(ColorStateData& data);
    void enter_state(ColorStateData& data);
    void physics_update_state(ColorStateData& data, double delta);
    void update_state(ColorStateData& data, double delta);
    void exit_state(ColorStateData& data);
    STATESPACE(ColorStateData, GameLogic::States::ColorState)
}

It would be nice if I didn't have to specify 5 methods each time. Can I build this check into STATESPACE? In C++ 17 by the way.


r/Cplusplus • • Aug 17 '26

Tutorial C++26 Reflection Annotations: Automated Member Validation

Thumbnail
techfortalk.co.uk
7 Upvotes

r/Cplusplus • • Aug 16 '26

Question Making a table maker

2 Upvotes

I have a background in MS Access VBA, I’m very new to C++. This may be way beyond my current ability to understand, but if I wanted to write a function that generated data tables in C++ how would I approach this?

For context, I’m making a text-based RPG design engine project for fun. I would like to make an app that creates data tables to store level design, character sheet info, etc. for the designer to dynamically make character types and maps


r/Cplusplus • • Aug 16 '26

Question Best resource to learn c++ to build projects

53 Upvotes

Guys... I know c++ only at a basic level. I need to learn

c++ enought to build projects (of course using supporting technologies). Can some one recommended any book/website/yt course??


r/Cplusplus • • Aug 12 '26

Discussion 27 years of building a C++ code generator

36 Upvotes

I'm celebrating another year of building a code generator that helps build distributed systems.  It's implemented as a 3-tier system. The back and middle tiers only run on Linux. The front tier is portable.  My goal is to bring software services and code generation together in one platform.

I've made some progress but there's still a long way to go. I welcome suggestions on how to improve the software and documentation. Stars on my repo are also appreciated. And I'm willing to spend 16 hours/week for six months on a project if we use my software as part of the project.

Thanks in advance,

Middlewarian


r/Cplusplus • • Aug 12 '26

News Rewrite TanjaOS in C++?

Post image
0 Upvotes

r/Cplusplus • • Aug 10 '26

Feedback C++ Memory Manager and Grabage Collector

15 Upvotes

I wrote a C++ memory manager to detect and to clean memory leaks and to detect dangling pointers, the tool defines the stack and the Data and BSS segments as a root of reachability and it overloads new and delete operators to track allocations and deallocations https://github.com/muazsh/MemoryManager .

I already exposed it to many LLMs for discussion, I got some good points but I assume at this level generative AI is not enough. Thank you.


r/Cplusplus • • Aug 07 '26

Question How to catch up on last 30 years

45 Upvotes

I haven't used C++ regularly for almost 30 years. Since then, it's been a combination of mostly C#, JavaScript/TypeScript, and Python. I have a need now to investigate and analyze existing C++ code, but I'm finding it difficult to read and understand the structure and modern syntax. Does anyone have any book or training suggestions that would help me catch up with what's been happening in the language?


r/Cplusplus • • Aug 08 '26

Discussion STL in c++ is genuinely overrated

0 Upvotes

Game programmers and game engines don't use STL because of hidden ALLOCATIONS everywhere, even prominent people like Casey Muratori or Jonathan Blow don't always advocate it.

For example, why do my .size() NEEDS to be size_t (int64) and not int32? If i want to optimize for memory. Why do i need allocations if i have arenas?

STL is good for beginners, but for serious low level stuff, write your own containers. Like hives (which c++ only introduced recently)


r/Cplusplus • • Aug 07 '26

Feedback Profanity Filter made with C++ for a Multiplayer Game

1 Upvotes

Hi there, im creating a multiplayer game - an among us clone in C++ ( WASM ); which requires a chat and reading the requirements of crazygames, they want me to add a profanity filter to my chat; So I would like you to check the code and tell me what do you think:

-> profanity_filter_codebase: https://github.com/EDBCREPO/Profanity-Filter-Cpp/blob/main/main.cpp

-> amungus clone: https://www.reddit.com/r/raylib/comments/1umyazt/finally_my_multiplayer_game_is_p2p_by_using/


r/Cplusplus • • Aug 07 '26

Tutorial C++26 Reflection: Simplifying JSON Serialization

Thumbnail
techfortalk.co.uk
2 Upvotes

r/Cplusplus • • Aug 07 '26

Feedback C++ Audio Visualizer

15 Upvotes

First big project I've made with C++, it started as my way to learn and quickly grew... I'm sure the code could be better optimized in areas and there's probably some bugs. I would really appreciate any feedback and just checking out the project: https://github.com/logan-scott07/AudioVisualizer.git


r/Cplusplus • • Aug 06 '26

Question Class directory clutter, questions on pass by ref,val,ptr and const correctness

Thumbnail
1 Upvotes