Stay up-to-date with everything C++! Content directly fetched from the subreddit just for you. Join our group for discussions : @programminginc Powered by : @r_channels
Astronautical Calculator
https://github.com/YeahIamNickPap/Astronautical-Calculator/tree/Astronautics
https://redd.it/1m35ut5
@r_cpp
I was not able to answer why we need virtual functions in C++
I told the interviewer that if we need to call the dervied class function using base class pointer at runtime, then we need to have our base class function as Virtual. But interviewer asked "why not simple use dervied object pointer or dervied object to call that function? What's the use case for virtual functions?"
What answer was expected here?
can anyone explain this to me in really easy way with real world example if possible.
https://redd.it/1m2z8h9
@r_cpp
C++ Trailing Return Types
https://danielsieger.com/blog/2022/01/28/cpp-trailing-return-types.html
https://redd.it/1m2x4mp
@r_cpp
post-Sofia mailing
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/#mailing2025-07
https://redd.it/1m2ryzp
@r_cpp
Created tool that uses LLMs+profilers to automatically optimize code
Hey, I was working this summer on Functio - a tool to automatically do low-level optimizations of cpp code.. It uses profiling tools and language models to find and analyze bottlenecks and hotspots in your code, and then rewrites these critical parts to achieve better performance. Functio can invoke tools like perf utilities, static analyzers, LBR, analyze flamegraphs, and more, depending on context.
If you're working on performance-critical applications, I'd love to chat.
Short demo here
https://redd.it/1m2n57o
@r_cpp
Simple DOUBT
so i was making a lying half hourglass shape using c++ loops
ATTEMPT 1;
//printing upper half hourglass
\#include <iostream>
using namespace std;
int main() {
int w;
cout << "enter the base width (must be an odd number) : ";
cin >> w;
int m = (w+1)/2;
for(int i=0;i<m;i++) {
for(int j=0;j<i+1;j++) {
cout << "*";
}
for(int j=0;j<w-2*(i+1);j++) {
cout << " ";
}
for(int j =0;j<i+1;j++) {
cout << "*";
}
cout << endl;
}
}
ATTEMPT 2;
//printing upper half hourglass
#include <iostream>
using namespace std;
int main() {
int w;
cout << "enter the base width (must be an odd number) : ";
cin >> w;
int m = (w+1)/2;
for(int i=0;i<m;i++) {
for(int j=0;j<i+1;j++) {
cout << "";
}
for(int j=0;j<w-2(i+1);j++) {
cout << " ";
}
for(int j =0;j<i+1;j++) {
if(i==(m-1)) {
for(int k =0;k<m-1;k++) {
cout << "";
}
}
else {
cout << "";
}
}
cout << endl;
}
}
https://redd.it/1m2dej1
@r_cpp
Header file issues
Hi guys I’m working on my first larger C++ project building a central limit order book. The code worked fine until I split it into .h and .cpp files. I am new to this concept so would appreciate any help.
My repo is on GitHub: GitHub.com/JudeWallace/limit-order-book
The error is coming from OrderNode.h with the message:
error SelfTradePrevention does not name a type
SelfTradePrevention stpf = SelfTradePrevention::RTO
Also if you do look through my repo please tell me and better cpp ways
https://redd.it/1m26u35
@r_cpp
Early lessons from building a C++ foundation for engineering computation
Over the past few weeks I’ve been building the foundation for a computational system intended for engineering software. The first part I’m working on deals with 2D geometry: representing and computing curves, surfaces, and their relationships in a way that is robust, accurate, and maintainable.
Working on this has given me a much clearer picture of how critical the design decisions are when working in C++. Getting the abstractions right early enough to stay modular, while avoiding unnecessary overhead, is not easy—and it’s already forced me to rethink some of my first attempts.
One of the biggest challenges has been handling numerical stability without littering the code with special cases. I’ve leaned heavily on standard algorithms I’d seen before—Gauss-Kronrod quadrature, Horner’s method, Newton-Raphson, Aberth-Ehrlich—but adapting them to fit cleanly into a reusable, testable C++ module is a different challenge altogether.
I’ve been cautious about over-engineering at this stage, but also don’t want to back myself into a corner later. So far, focusing on clear interfaces and keeping state as isolated as possible has helped.
For those of you who’ve built C++ libraries of significant size: how do you approach finding the right level of abstraction early in a project, when it’s still unclear what the eventual direction will be?
https://redd.it/1m1hzu6
@r_cpp
The Best C++ Library
https://mcyoung.xyz/2025/07/14/best/
https://redd.it/1m17npu
@r_cpp
C++ Refactoring Tools Test Suite
https://github.com/LegalizeAdulthood/refactor-test-suite
https://redd.it/1m13gnk
@r_cpp
Struggling to progress
Recently i have been struggling with learning cpp , Everytime i try to code something the code is too complex even if i make chatgpt simple and if i try to code without chatgpt i go days trying to piece together until i ask chatgpt for help it is hard everytime i look at code it looks complex and its like something i have never seen before except for the std::cout or return in the functions when i try to build up on a project i struggle to find anything to implement my repo: https://github.com/Jilio013/Basic-Tokenizer.git
https://redd.it/1m0xkex
@r_cpp
How I found a $200k C++ Dev job
I realized many roles are only posted on internal career pages and never appear on classic job boards.
So I built an AI script that scrapes listings from 70k+ corporate websites.
Then I wrote an ML matching script that filters only the jobs most aligned with your CV, and yes, it actually works.
You can try it here (for free).
(If you’re still skeptical but curious to test it, you can just upload a CV with fake personal information, those fields aren’t used in the matching anyway.)
https://redd.it/1m0yf2b
@r_cpp
Is there any good sources for Digit Dp and Dp on Trees??
I need to do these topics but I cannot find a good source.
https://redd.it/1m0rnrq
@r_cpp
Latest News From Upcoming C++ Conferences (2025-07-15)
This Reddit post will now be a roundup of any **new** news from upcoming conferences with then the full list being available at [https://programmingarchive.com/upcoming-conference-news/](https://programmingarchive.com/upcoming-conference-news/)
**EARLY ACCESS TO YOUTUBE VIDEOS**
The following conferences are offering Early Access to their YouTube videos:
* **ACCU Early Access Now Open (£35 per year) -** Access all 91 YouTube videos from the 2025 Conference through the Early Access Program. In addition, gain additional benefits such as the journals, and a discount to the yearly conference by joining ACCU today. Find out more about the membership including how to join at [https://www.accu.org/menu-overviews/membership/](https://www.accu.org/menu-overviews/membership/)
* Anyone who attended the ACCU 2025 Conference who is NOT already a member will be able to claim free digital membership.
**OPEN CALL FOR SPEAKERS**
The following conference have open Call For Speakers:
* **C++ Day** \- Interested speakers have until **August 25th** to submit their talks. Find out more including how to submit your proposal at [https://italiancpp.github.io/cppday25/#csf-form](https://italiancpp.github.io/cppday25/#csf-form)
**OTHER OPEN CALLS**
* **ADC Call For Talk Reviewers Now Open** \- Anyone interested in reviewing talk proposals for ADC 2025 can now review talks at [https://submit.audio.dev](https://submit.audio.dev)
* **ADC Call For Online Volunteers Now Open** \- Anyone interested in volunteering online for ADCx Gather on Friday September 26th and ADC 2025 on Monday 10th - Wednesday 12th November have until September 7th to apply. Find out more here [https://docs.google.com/forms/d/e/1FAIpQLScpH\_FVB-TTNFdbQf4m8CGqQHrP8NWuvCEZjvYRr4Vw20c3wg/viewform?usp=dialog](https://docs.google.com/forms/d/e/1FAIpQLScpH_FVB-TTNFdbQf4m8CGqQHrP8NWuvCEZjvYRr4Vw20c3wg/viewform?usp=dialog)
* **CppCon Call For Volunteers Now Open** \- Anyone interested in volunteering at CppNorth have until August 1st to apply. Find out more including how to apply at [https://cppcon.org/cfv2025/](https://cppcon.org/cfv2025/)
**TICKETS AVAILABLE TO PURCHASE**
The following conferences currently have tickets available to purchase
* **Meeting C++** \- You can buy online or in-person tickets at [https://meetingcpp.com/2025/](https://meetingcpp.com/2025/)
* **CppCon** \- You can buy regular tickets to attend CppCon 2025 in-person at Aurora, Colorado at [https://cppcon.org/registration/](https://cppcon.org/registration/).
* **ADC** \- You can now buy early bird tickets to attend ADC 2025 online or in-person at Bristol, UK at [https://audio.dev/tickets/](https://audio.dev/tickets/). Early bird pricing for in-person tickets will end on September 15th.
* **C++ Under The Sea** \- You can now buy early bird in-person tickets to attend C++ Under The Sea 2025 at Breda, Netherlands at [https://store.ticketing.cm.com/cppunderthesea2025/step/4f730cc9-df6a-4a7e-b9fe-f94cfdf8e0cc](https://store.ticketing.cm.com/cppunderthesea2025/step/4f730cc9-df6a-4a7e-b9fe-f94cfdf8e0cc)
* **CppNorth** \- Regular ticket to attend CppNorth in-person at Toronto, Canada can be purchased at [https://store.cppnorth.ca/](https://store.cppnorth.ca/)
**OTHER NEWS**
* **Last Chance to Buy CppNorth Tickets** \- CppNorth starts on Sunday 20th July in Toronto, Canada. Buy a ticket today at [https://store.cppnorth.ca/](https://store.cppnorth.ca/)
* **Provisional Meeting C++ Schedule Now Available** \- More information about the schedule can be found at [https://meetingcpp.com/meetingcpp/news/items/The-end-of-ealry-bird-tickets-and-a-first-schedule.html](https://meetingcpp.com/meetingcpp/news/items/The-end-of-ealry-bird-tickets-and-a-first-schedule.html)
Finally anyone who is coming to a conference in the UK such as ADC from overseas **may now be required to obtain Visas to attend**. Find out more including how to get a VISA at
Need some guidance on low latency programming is it worth pursuing?
Hey folks,
I'm an undergrad entering my final year. My background so far has mainly been around web development and general SDE work. Recently, I joined a fintech startup as an intern, and they assigned me to work on their backtesting module originally written in Python which I then converted to C++.
I managed to get ~5x speedup compared to the Python version, mostly by using basic stuff like unordered_map and a simple DP-style cache. But honestly, I know this is nowhere near what C++ is really capable of in terms of performance and low-level optimization.
Now, as placement season approaches, I’m in a dilemma. Should I continue on the typical SDE path, or should I dive deep into low-latency programming or some niche like that? The problem is I come from a college that HFTs in India don’t hire from (they mostly recruit from 2-3 top-tier colleges, mine’s not even close), and ironically, I’m not getting shortlisted for SDE roles either.
So I wanted to ask:
What kind of roles and opportunities does low latency programming actually open up?
Is it just HFTs, or are there other paths as well?
And if it is worth it for someone in my position, what should be my starting point? What should I learn, practice, or build?
Sorry if this doesn’t belong here just trying to figure out my direction and would really appreciate any insights.
Thanks!
https://redd.it/1m0j22j
@r_cpp
Need Guidance for C++ Dev Role Interview
Hello Everyone, I was looking for guidance for my interview on this 24th 🙏.
The company(GoQuant) is a digital asset trading infrastructure provider. The company focuses on delivering high-performance market data and execution services to leading financial institutions.
I will be getting interviewed for C++ Developer Intern role. I want to know what kind of specific things I can prepare for it. Please ,anyone with experience in tech roles of HFT or finance companies,I need help.
This can be my first corporate experience 🥺.Help
https://redd.it/1m34kuf
@r_cpp
What do you think about QT as a GUI library?
I wanted to start a graphical project and idk much about GUIs.
https://redd.it/1m2pyl2
@r_cpp
Error when running project
I am rather new to C++ and was wanting to learn it for some future projects. I'm relatively self taught in most languages so I haven't gotten professional experience with setting up C++. I've been having an issue where when running the file an error message pops up complaining about
"launch: program 'C:\\Users\\Name\\Desktop\\LearningC++\\Project1.exe' does not exist"
I was told that this is a compiler issue so I followed a tutorial which included installing a compiler called minGW. (Video:https://www.youtube.com/watch?v=DMWD7wfhgNY)
Before I start doing anything big I would like to have the ability of running a 'Hello World' project first 😂. Does anyone know any solutions to this problem?
https://redd.it/1m2vq71
@r_cpp
Need to know improvements for my memory pool!!
So here's the thing around 2-3 months before I made a memory pool in C it was taken from a research paper by Ben Kenwright it talks about how to implement a fixed size memory pool without any loop overhead!! A small help ... can you guys please review it or you can contribute or what improvements can I work on.. beside that you guys can contribute to my code to make it more useful for real life use-cases(its kind of my dream :) ) !!!
link: https://github.com/ankushT369/cfxpool
https://redd.it/1m2rdrf
@r_cpp
i am kinda stuck! what should i do next? have the projects i made has any significance?
https://github.com/Akshat227
https://redd.it/1m2eawr
@r_cpp
C++ Projects: Level 1 to 10 Progression
https://claude.ai/public/artifacts/dccfed83-ecd8-4b76-b89f-4dbb4a180513
https://redd.it/1m27rah
@r_cpp
mess up computer
im new to this and i want to build software for the system and maybe replicas os word processors and other tools.
im just wondering that if i attempt to make something and it ends up being bad wll it destroy my computer interface or fuck up the memory. and what is the likely hood if so
https://redd.it/1m1w5ey
@r_cpp
Three Ways For C++ Thread Synchronization in C++11 and C++14
https://chrizog.com/cpp-thread-synchronization
https://redd.it/1m1eovt
@r_cpp
C++26: std::format improvements (Part 2)
https://www.sandordargo.com/blog/2025/07/16/cpp26-format-part-2
https://redd.it/1m156ij
@r_cpp
I built an authoritative network stack...
I released it free under the MIT License.
The latest version is a debug-only static library — for now.
This is the real backbone behind RiftForged — a game that doesn’t lie to its players and doesn’t fake sync.
It handles reliable UDP, encryption, compression, and RTT/RTO estimation at scale.
What you’re seeing in the gif below is 6,000 client threads simulating movement with full encryption and packet-level reliability.
I built it from raw socket I/O — no ENet, no RakNet, no QUIC.
https://github.com/TheToastiest/RiftNet
https://giphy.com/gifs/H87nMPSkLCvOZ71sz0
https://redd.it/1m0z5g9
@r_cpp
I want to start programming in C++ (I've never programmed)
Today I decided that I want to study programming and I'm interested in c++, but I don't really know where to start, I don't even know what I should download. Could anyone help me with how to take this initiative and whether I should start in C++ or another language?
https://redd.it/1m0zk3d
@r_cpp
Show "rodata" section in Compiler Explorer IDE mode?
When I compile a single file in Compiler Explorer I can see all the constants like string literals in the output window.
const char* ss = "abcdef";
.LC0:
.string "abcdef"
mov rbx,QWORD PTR [rip+0x2ee0] # 404018 <ss>
[https://homeofficemedia.blog.gov.uk/electronic-travel-authorisation-eta-factsheet-january-2025/](https://homeofficemedia.blog.gov.uk/electronic-travel-authorisation-eta-factsheet-january-2025/)
https://redd.it/1m0msvl
@r_cpp
Just graduated & CPP Jobs
Hey everyone!
I’ve recently graduated in CS.
I absolutely love cpp, making high performant / detail oriented applications, concurrency, OSes, networks, and all that stuff, but not really into eletronics/embedded nor I find the QoL / pay interesting in comparison to those as, say, web dev jobs.
I’m writing to ask if are there SWE jobs that look for people who are are able to write good cpp, high performant code, this kind of all-rounded engineer that understands the lower-level stuff? Where do you find these jobs? Or may you share the areas you’re working in?
Apologies if this is not the most suitable sub for these questions.
Thanks in advance!
https://redd.it/1m0lj6q
@r_cpp
C++: how to implement lazy evaluation + SIMD for vector operations: V = v1 + v2 - k*v3;
I have developed a fully functional expression template `Vector<T>` class that supports delayed (lazy) evaluation, enabling expressions such as `V = v1 + v2 - 3.14 * v3`. The underlying data of `Vector` is stored contiguously and aligned to 32 or 64 bytes for efficient SIMD access.
For large vectors—typically with over one million elements—we aim to enable SIMD acceleration for arithmetic operations. In simple cases like `V = v1 + v2`, SIMD can be directly implemented within the `VectorAdd` expression (e.g., via an `evaluate()` function). However, when either `lhs` or `rhs` in `VectorAdd(lhs, rhs)` is itself an expression rather than a concrete `Vector<T>`, the `evaluate()` function fails, since intermediate expressions do not own data.
I wonder if there are any good C++ examples on GitHub or elsewhere for the solution of fully SIMD-enabled lazy evaluation.
https://redd.it/1m0deq3
@r_cpp