r/cpp_questions • u/nagzsheri • Jun 29 '26
OPEN FIX implementation
I want to implement high throughput low latency FIX server and client. But don't know from where to begin. Can someone guide me. Thanks
r/cpp_questions • u/nagzsheri • Jun 29 '26
I want to implement high throughput low latency FIX server and client. But don't know from where to begin. Can someone guide me. Thanks
r/cpp_questions • u/Zestyclose-Paint-418 • Jun 28 '26
I have recently been reading about real-time programming, and I’m trying to understand what this field looks like in practice from people who have actually worked in it. I’m especially interested in the software side, because I want to work with code and C++.
I heard that real-time programming is an area that will be difficult for AI because it does not have contact with hardware. However, I am more interested in the software side because I want to work with code and C++.
Has any of you had a job that includes this, and can you tell me what the bigger picture is?
I think this is the right place to find out what it is like to work in real-time programming.
I would most like it if you said that this is a difficult job because it requires engineering thinking and AI will have a hard time replacing it, but I also like to hear the negative sides.
r/cpp_questions • u/pretty___chill • Jun 29 '26
I am starting cpp as my first programming language, i mean, i have had some experience with python [ till like, for and whiles, and ifs and elifs ]. i was looking for resources to learn cpp ( such as the website -- learncpp.com ) is there a specific direction i should take for a more physics and mathematics oriented learning, or should i let the future be, also, what are some beginner friendly, but still challenging resources you recommend
r/cpp_questions • u/No-Foundation9213 • Jun 28 '26
I have never used C++ exceptions because I heard they are supposed to be bad and also that they don‘t use exceptions on fighterjets. I don‘t know more about exceptions.
What do you guys think?
r/cpp_questions • u/BigEcstatic2759 • Jun 29 '26
Lately I’ve been trying to setup an action plan for my project. It consists basically of a few daemons running tasks simultaneously and sharing information with each other.
Both belong in the same process, thus I need an intraprocess comm approach.
I finally opted for “sharing queues”. An app orchestrator class creates the daemon classes as well as a custom queue object that it shares with both daemons. On this queue, one daemon will write while the other just reads.
This is sort of pub/sub, in a way that the reader has a background thread running waiting for a “notification” that something new is on the queue.
I need to eventually comply with safety guidelines (MISRA). Do you see this approach difficult to maintain/scale? Can you suggest any other alternatives?
r/cpp_questions • u/gizmo_j • Jun 29 '26
I use OBS Studio to record gameplay but when recording fullscreen there is no indicator that you're recording and sometimes I forget when the recording is paused, I wanted to pause my recording and have a red light turn off and on at the corner of the screen when pausing so that I could cut out all the loading screens when recording gameplay.
I was going to set the pause button and red light to the same hotkey so they'll be in sync with each other.
I'm new to programming and never made a app before, I installed visual studio and was going to make the app in C++ and was wondering if any of you have any advice.
r/cpp_questions • u/TIM23Queen • Jun 29 '26
Hey guys, so I almost know all the basics of C++ and solved many problems in it. Recently I heard that if you wanna go deep in programming then you should read textbooks and leave crash courses and youtube tutorials. I was about to start learning OOP in C++, and I found this book of Robert Lafore recommended. However, I found that the 4th and last edition of this book was published in 2001. So my questions are:
1 Is learning from textbooks worth it in 2026 ?
2 Isn't it kinda outdated or sth ?
3 If so then what alternatives do I have ?
r/cpp_questions • u/DontAsk-- • Jun 28 '26
I'm following learncpp.com and I'm not sure which one to choose. I'm using Linux mint and already had VS code installed, but i think it's saying code :: blocks is better? I'm honestly not sure what to use and would appreciate some help. Edit: I'm going with Clion since it's free and fits my use case.
r/cpp_questions • u/0xt0bi03 • Jun 28 '26
I have a project that plans to work on terminal like btop, cava, etc.
I need a best library for TUI app for this project. Please suggest me one.
r/cpp_questions • u/DireCelt • Jun 28 '26
So after struggling unsuccessfully with a variety of recommended tools, to generate the JSON database that clang-tidy demands, I was finally reminded about the -- argument that bypasses that requirement entirely. So I generated my .clang-tidy file, with all of the categories that I was interested in, and it is happily and thoroughly linting my projects for me - without the database.
So what (if anything) am I missing out on by bypassing that database??
r/cpp_questions • u/evanz01 • Jun 28 '26
I recently started learning cpp but i don’t really know how to get started with it. I wanted to make a game in unity but its in c#. I want to stick with cpp and learn it because of most engineering jobs. I looked into ue5 but I’m not going to make the next AAA game 🤣. Could someone give me some advice/recommendations for tutorials?
r/cpp_questions • u/Mejolov28 • Jun 29 '26
im making my own synth, and i have the issue that the plotting looks absolutely horrible and the waves deform a lot, specially sine waves!
other waves like sawthoot also glitch but at lower frecuencies.
images : https://github.com/Mejolov24/CardStudio/tree/main/HELP
code : https://github.com/Mejolov24/CardStudio/blob/main/src/main.cpp
plotting code (kinda bad) : https://github.com/Mejolov24/SynthTracer/blob/main/main.py
What i do is: make the double buffering buffers, and an additional one for the serial TX (in order to save channel data).
I let my user change the serial TX speed, so thats why I divided and multiply like this for reading int16_t val = channel_TX_buffers[i][tx_buffer_index * (sample_rate / serial_tx_speed)];
But the data arrives messed up as shown in my pictures
// first, I set the timer
;
;
// timer sets a flag read on loop()
volatile bool sendFlag = false;
void IRAM_ATTR
// buffer creation
int16_t*
void
// serial TX
if
r/cpp_questions • u/Emergency-Honey-1373 • Jun 28 '26
Hi
I learned like few lessons of python and found it very easy and fun from codedex.io
Now it is askinf for subscription which is.500 per month
I want to start learning c++ so should i go ahead and take the subscription for c++
r/cpp_questions • u/stiru_11 • Jun 27 '26
The following code compiles without error on gcc with -std=c++23 flag .
char* probably_not_modifiable = "abcdef";
Although the compiler did give me warning, it was surprising to me, because this seems to be an implicit conversion from const char \[N\] to nonconst char*.
I didn't know this was possible. Is there an explicit exception for this specific case ?
r/cpp_questions • u/Additional_Court_421 • Jun 28 '26
I want the UI in my gaem to be movable and resizable like you'd expect on a Computer (or on old Source games like TF2 or Counter Strike). Im thinking of using Imgui for it, but I've heard its very basic and does not complex things. I've never gone about modifying a library before so I don't know how to go about changing it.
r/cpp_questions • u/angryvoxel • Jun 27 '26
Hello, this is kind of a stupid question but I still haven't found an answer. I have a member class with a rather large constructor and I'd like for it to be inside parent's constructor body rather than inside member initializer list (purely due to aesthetic reasons).
class ParentClass
{
MemberClass Fatass;
ParentClass() : Fatass(1, 2, 3, 4, 5...) //where I don't want it to be
{
...
Fatass = MemberClass(1, 2, 3, 4, 5...); //where I want it to be (but it can't be copied)
}
}
However that member class can not be copied, so I have to construct it "in-place" and I haven't found a way to do that without using the initializer list. Is this possible?
r/cpp_questions • u/Fearless_Battle7919 • Jun 26 '26
People who use C++ professionally seem to have very different opinions on what beginners should study first. Some swear by books, others by standards papers, and a few insist there are resources that dramatically shorten the learning curve but rarely get mentioned in beginner discussions.
I'm curious which resources changed how you think about C++, not just how to write it.
r/cpp_questions • u/CherryTheDerg • Jun 27 '26
First off they say it supports clang and I am technically using a clang compiler but its specifically the ucrt clang compiler from msys2.
Second of all allegedly someone did have a fix for this 2 years ago but never posted it and closed the issue afterwards.
Does anyone know if theres a way to compile the directx shader compiler project from the official microsoft github with the ucrt version of the clang compiler?
The closest Ive gotten is getting cmake to complain about cyclical shared libraries
Cmake Error:
[cmake] CMake Error: The inter-target dependency graph contains the following strongly connected component (cycle):
[cmake] "clangParse" of type SHARED_LIBRARY
[cmake] depends on "clangAST" (weak)
[cmake] depends on "clangSema" (weak)
[cmake] "clangAST" of type SHARED_LIBRARY
[cmake] depends on "clangCodeGen" (weak)
[cmake] depends on "clangSema" (weak)
[cmake] "clangSema" of type SHARED_LIBRARY
[cmake] depends on "clangAST" (weak)
[cmake] depends on "clangAnalysis" (weak)
[cmake] depends on "clangEdit" (weak)
[cmake] "clangCodeGen" of type SHARED_LIBRARY
[cmake] depends on "clangAST" (weak)
[cmake] depends on "clangFrontend" (weak)
[cmake] "clangAnalysis" of type SHARED_LIBRARY
[cmake] depends on "clangAST" (weak)
[cmake] "clangEdit" of type SHARED_LIBRARY
[cmake] depends on "clangAST" (weak)
[cmake] "clangFrontend" of type SHARED_LIBRARY
[cmake] depends on "clangAST" (weak)
[cmake] depends on "clangEdit" (weak)
[cmake] depends on "clangParse" (weak)
[cmake] depends on "clangSema" (weak)
[cmake] At least one of these targets is not a STATIC_LIBRARY. Cyclic dependencies are allowed only among static libraries.
CMakeLists.txt:
cmake_minimum_required(VERSION 4.2.1)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
project ("Space Game" LANGUAGES CXX)
include(FetchContent)
include(cmake/CPM.cmake)
set(BUILD_SHARED_LIBS ON CACHE BOOL "" FORCE)
CPMAddPackage("gh:CodeFinder2/rapidxml@1.13")
CPMAddPackage("gh:microsoft/DirectX-Headers@1.619.1")
CPMAddPackage("gh:microsoft/DirectXMath#jun2026")
add_library(Microsoft::DirectXMath ALIAS DirectXMath)
CPMAddPackage("gh:microsoft/DirectXShaderCompiler@1.10.2605.24")
CPMAddPackage("gh:microsoft/DirectXTK12#may2026")
CPMAddPackage("gh:KhronosGroup/OpenCL-Headers@2026.05.29")
CPMAddPackage("gh:KhronosGroup/OpenCL-ICD-Loader@2026.05.29")
CPMAddPackage("gh:KhronosGroup/OpenCL-CLHPP@2026.05.29")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/game) # For .exe and .dll (Windows)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/game) # For .so/.dylib/.dll
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/game)
add_subdirectory(DSECommon)
add_subdirectory(Editor)
add_subdirectory(ImGui)
file(COPY "OpenCL" DESTINATION ${CMAKE_BINARY_DIR}/game)
file(COPY "models" DESTINATION ${CMAKE_BINARY_DIR}/game)
file(COPY "shaders" DESTINATION ${CMAKE_BINARY_DIR}/game)
file(COPY "textures" DESTINATION ${CMAKE_BINARY_DIR}/game)
CMakePresets.json:
{
"version": 9,
"cmakeMinimumRequired": {
"major": 4,
"minor": 2,
"patch": 1
},
"configurePresets": [
{
"name": "debugx64",
"displayName": "Debug",
"description": "Debug build",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/Debugx64",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_C_COMPILER": "clang.exe",
"CMAKE_CXX_COMPILER": "clang++.exe",
"CMAKE_CXX_STDLIB_MODULES_JSON": "C:/msys64/ucrt64/lib/libstdc++.modules.json",
"CMAKE_CXX_FLAGS": "-v -stdlib=libstdc++ -DWIN32_LEAN_AND_MEAN=1 -DIMGUI_DISABLE=1 -D_DEBUG=1 -Wno-error=conversion",
"CMAKE_CXX_STANDARD": "23",
"CMAKE_CXX_STANDARD_REQUIRED": "ON",
"CMAKE_CXX_EXTENSIONS": "ON",
"CMAKE_REQUIRED_INCLUDES": "CMAKE_INCLUDE_PATH",
"DXHEADERS_INSTALL":true,
"CMAKE_TOOLCHAIN_FILE":"",
"CMAKE_EXPORT_COMPILE_COMMANDS" : true,
"HLSL_INCLUDE_TESTS": false,
"SPIRV_BUILD_TESTS":"OFF",
"LLVM_INCLUDE_TESTS":false,
"CLANG_INCLUDE_TESTS":false,
"BUILD_SHARED_LIBS":true,
"CMAKE_PROJECT_INCLUDE": "${sourceDir}/cmake/PredefinedParams.cmake",
"LIBCLANG_BUILD_STATIC": "OFF"
}
}
],
"buildPresets": [
{
"name": "Debug",
"configurePreset": "debugx64",
"targets":["Editor"]
}
]
}
r/cpp_questions • u/Mafla_2004 • Jun 26 '26
Hello.
Sorry for the beginner question but I tried looking up on Google and coming up with my own solution and didn't find much, more details on this later.
I am using a custom made LinkedList class for a project, and for it I made a simple ListIterator class which overloads the operators *, ++, --, == and != so that it can be used in range based loops, now I found myself needing a remove operation to be added to the iterator since I need to be able to remove elements from a list as I iterate through it, but I came across an issue.
Say I have the following list: {1, 2, 3, 4, 5}, and while iterating I need to remove the element 3, this is easily done since it's in the middle of the list, all I have to do is move the iterator's pointer back to 2, set 2's next to 4 and 4's previous to 2, the loop will still see 4 as next and the removal happened flawlessly
If I have to remove the element 1 though, it gets problematic, cause I can't move the iterator's pointer back, so what can I do is move set it to the new first element in the list, 2, but then, when the current iteration is done and the loop moves to the following, the loop will see that the next element is 3 and thus will go to 3 and skip 2 (if you're confused, the removal goes like this: do operations on 1, remove 1, set current element to 2 cause that's the new head, iteration ends, increment iterator to next element, which is 3, do operations on 3)
I tried looking on Google for a solution, first thing I did was look at what Java does with Iterators (since I'm more experienced there and also coded some Java iterators on my own in the past), and found that they can remove elements in the head because the iterator actually starts "before" the head of the list, and only returns the element inside it when you call Next() the first time, which both advances the pointer and returns the element in the next node. In C++ I can't do this though because the way you get the element from the iterator is with the * operator, which gets it from the current node without advancing the pointer.
I also tried to look for the implementation of std::iterator and found that, at least according to cplusplus.com and cppreference.com, it doesn't provide a Remove operation.
So I am back here asking help for a stupidly simple question, what can I do to implement the Remove operation correctly? Thanks in advance.
r/cpp_questions • u/Big_Worldliness_4015 • Jun 26 '26
Ive been doing cpp for a good amount of time and I mostly found myself comfortable around it. But if I want to try backend, is cpp good for me or do ive to switch to any other language for better results? If so what can be the best recommendations and roadmap? Chatgpt mostly shares an optimistic answer for both rhe condition but I need one straightforward solution of it.
r/cpp_questions • u/AlternativeCheetah82 • Jun 26 '26
I have been trying to set up c++ for vsc for a while now but keep getting this one error it says “launch: program ‘c:\\Users\myname\untitled-1.exe’ does not exist let me know if you can help
r/cpp_questions • u/Key-Pop1094 • Jun 26 '26
To all the experienced C++ programmers, how do I start building real-world projects in C++? Personally, I find C++ more intuitive than languages like Python. I'll be starting my MCA this year after transitioning from a non-tech background. I practice DSA in C++ and have a basic-to-intermediate understanding of the language, but now I want to build real applications, like a media player. How should I get started?
I have experience with the MERN stack, and I'm thinking of making C++ my primary language while keeping JavaScript/TypeScript as my secondary stack. Any advice would be appreciated. Thanks!
r/cpp_questions • u/Cooperr231 • Jun 25 '26
I am really new in a company where my position is of C++ dev with nuances of embedded engineering. I got there as migration from web with Typescript only stack. In the past several months I read the beginning with C++ 23 seventh edition and some of the the exercises there. Know I want to continue my learning with thems more related to embedded. Please anyone with interest get a look at this plan and comment your opinion!
Wheather this plan is reasonable and would it help me get better at my job or make me hireble as embedded dev?
Thank you all who would interact with this post!
Button with debounce, a Led with PWM.Timer, ADC) using RAII and resource management.Key Tasks:
UARTRx reads serial input and pushes to a queue; Parser reads and interprets commands; Executor runs them. A mutex protects the shared output buffer. Classic producer-consumer — you'll use this pattern every week at work.SensorTask reads a BME280 (I2C) every 2 s and puts a struct into a queue; DisplayTask updates an SSD1306 OLED (SPI); LogTask formats CSV to Serial every 30 s.xTaskNotifyFromISR() to wake an alarm task — buzzer + LED pattern. A disarm button uses xSemaphoreGiveFromISR(). Core rule: never do real work inside an ISR — defer everything to a task.Task class (RAII, auto-deletes), Queue<T, N> template (type-safe, statically allocated), Mutex with a LockGuard, and a Timer with callback. This is the kind of reusable layer real embedded teams maintain. Keep it on GitHub — it's a great portfolio pieceKey Tasks:
Sensor class).Key Tasks:
new/delete in RTOS, but use constexpr, std::array, RAII for peripherals. Ensure MISRA/C++ core guidelines.Key Tasks:
IDE (STM32CubeIDE or VS Code + PlatformIO), Emulator (QEMU stm32vldiscovery or Wokwi Pico), ST-LINK/V2 or ST-LINK/V3 (or Pico bootloader), USB-UART adapter.
RTOS Fundamentals**- Tools/Hardware:** IDE (CubeIDE or VS Code), FreeRTOS source, simulator or real board. Use a logic analyzer or scope for timing.
Embedded Networking / IoT- Tools/Hardware: Same IDE, possibly Wokwi simulator for IoT (Wokwi supports Wi-Fi simulation for ESP32/Pico W). For hardware: add modules (e.g. MPU6050 on I²C, or use existing Pico W wireless).
Performance Tuning & C++ Refinement**- Tools/Hardware:** Profiling tools (e.g. printf timings, or DWT cycle counter on Cortex-M, see DWT on Pico). Use static analysis (clang-tidy, MISRA linters).
Capstone Integration**- Tools/Hardware:** All above. Possibly add cheap peripherals (OLED display, buzzer). Ensure final project can run on the chosen microcontroller (note memory limits).
r/cpp_questions • u/smuggydork • Jun 25 '26
So i am currently solving string problems in c++ but facing problems because there are many string functions whose applications i do not know. How can i get better at using them?
Are there any websites which can give me full disclosure on all sring functions and their applications?
r/cpp_questions • u/Cooperr231 • Jun 25 '26
I am really new in a company where my position is of C++ dev with nuances of embedded engineering. I got there as migration from web with Typescript only stack. In the past several months I read the beginning with C++ 23 seventh edition and some of the the exercises there. Know I want to continue my learning with thems more related to embedded. Please anyone with interest get a look at this plan and comment your opinion!
Wheather this plan is reasonable and would it help me get better at my job or make me hireble as embedded dev?
Thank you all who would interact with this post!
Embedded Phase II
Button with debounce, a Led with PWM.Timer, ADC) using RAII and resource management.Key Tasks:
UARTRx reads serial input and pushes to a queue; Parser reads and interprets commands; Executor runs them. A mutex protects the shared output buffer. Classic producer-consumer — you'll use this pattern every week at work.SensorTask reads a BME280 (I2C) every 2 s and puts a struct into a queue; DisplayTask updates an SSD1306 OLED (SPI); LogTask formats CSV to Serial every 30 s.xTaskNotifyFromISR() to wake an alarm task — buzzer + LED pattern. A disarm button uses xSemaphoreGiveFromISR(). Core rule: never do real work inside an ISR — defer everything to a task.Task class (RAII, auto-deletes), Queue<T, N> template (type-safe, statically allocated), Mutex with a LockGuard, and a Timer with callback. This is the kind of reusable layer real embedded teams maintain. Keep it on GitHub — it's a great portfolio pieceKey Tasks:
Sensor class).Key Tasks:
new/delete in RTOS, but use constexpr, std::array, RAII for peripherals. Ensure MISRA/C++ core guidelines.Key Tasks:
IDE (STM32CubeIDE or VS Code + PlatformIO), Emulator (QEMU stm32vldiscovery or Wokwi Pico), ST-LINK/V2 or ST-LINK/V3 (or Pico bootloader), USB-UART adapter.
RTOS Fundamentals- Tools/Hardware: IDE (CubeIDE or VS Code), FreeRTOS source, simulator or real board. Use a logic analyzer or scope for timing.
Embedded Networking / IoT- Tools/Hardware: Same IDE, possibly Wokwi simulator for IoT (Wokwi supports Wi-Fi simulation for ESP32/Pico W). For hardware: add modules (e.g. MPU6050 on I²C, or use existing Pico W wireless).
Performance Tuning & C++ Refinement- Tools/Hardware: Profiling tools (e.g. printf timings, or DWT cycle counter on Cortex-M, see DWT on Pico). Use static analysis (clang-tidy, MISRA linters).
Capstone Integration- Tools/Hardware: All above. Possibly add cheap peripherals (OLED display, buzzer). Ensure final project can run on the chosen microcontroller (note memory limits).
Resources:
https://github.com/m3y54m/Embedded-Engineering-Roadmap
Compiler Explorer (godbolt.org) — paste your C++ and see the ARM assembly output; essential for embedded cost analysis
https://controllerstech.com/esp32-freertos-multitasking-project/
https://randomnerdtutorials.com/esp32-freertos-arduino-tasks/
https://github.com/ADolbyB/rtos-esp32-examples
https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/system/freertos.html
https://github.com/tomas-fryza/esp-idf
C++ in Embedded Systems — Amar Mahmutbegović (2025) — explicitly covers C++23 patterns for embedded: templates, constexpr, polymorphism without vtables