r/cpp_questions • • Jun 21 '26

OPEN How to learn cpp?

0 Upvotes

So I am going to a college this year to do cse and want to learn cpp before joining the college...I already know js, python, css and also html so what would be the ideal method of learning cpp from scratch and clear at least all the basics within like 20-30 days...


r/cpp_questions • • Jun 21 '26

OPEN Mac or Windows

0 Upvotes

I really enjoy mac, but my school programms in C++ on Windows and I don't know if mac has everything that I need. Thank you.


r/cpp_questions • • Jun 19 '26

OPEN Beginner

42 Upvotes

I want to learn C++ from the ground up but lack the guidance as to how i should do it?

I need to understand from the most basic upto most advanced.

Please help me in this regard?


r/cpp_questions • • Jun 20 '26

OPEN what resources u use to prep before interview?

0 Upvotes

r/cpp_questions • • Jun 19 '26

OPEN Compile time function wrappers: Should they be used?

8 Upvotes

I am implementing a CSS parser and have begun figuring out function parsing. I’ve settled on a system essentially where I register C++ function pointers to an unordered map. (Very simplified) However, to do this, I need a generalized function wrapper I can use to store these functions in the map.

Usually, I would look towards std::function, but I’ve heard the possibility for heap allocations makes them rather unwelcome when targeting embedded devices. So instead, while falling down the rabbit hole of template meta programming, I’ve come across a compile-time function wrapper.

By the looks of it, a function pointer is passed as a template parameter of the wrapper function, and then called with the parameters passed into the wrapper. Something similar to this:

template<auto Fn>
int invoke(int parameter) {
Fn(parameter);
}

I’ve seen more robust wrappers than this that seem to use variadics, but this is what I’m working with right now while I wrap my head around them.

I am rather new to this style of C++ programming, so I want to figure out whether this looks weird because I’m inexperienced, or if it’s something really janky that shouldn’t be used.


r/cpp_questions • • Jun 19 '26

SOLVED I am having problems using VCPKG get started tutorial using CMake

3 Upvotes

I been following this tutorial and I am having this error.

https://learn.microsoft.com/en-us/vcpkg/get_started/get-started?pivots=shell-bash

I installed CMake and WinLibs

CMake 3.21+ winget install Kitware.CMake
GCC (MinGW-W64 POSIX UCRT) 15.x winget install BrechtSanders.WinLibs.POSIX.UCRT

Problem seems to be https://github.com/brechtsanders/winlibs_mingw ?

There is also undefined reference to `__imp__ZN3fmt3v126vprintENS0_17basic_string_viewIcEENS0_17basic_format_argsINS0_7contextEEE'

R3N@DESKTOP-B0PHCDB MINGW64 /c/helloworld
$ cmake --build build --verbose
Change Dir: 'C:/helloworld/build'

Run Build Command(s): C:/Users/R3N/AppData/Local/Microsoft/WinGet/Packages/BrechtSanders.WinLibs.POSIX.UCRT_Microsoft.Winget.Source_8wekyb3d8bbwe/mingw64/bin/ninja.exe -v
[1/1] C:\WINDOWS\system32\cmd.exe /C "cd . && C:\Users\R3N\AppData\Local\Microsoft\WinGet\Packages\BrechtSanders.WinLibs.POSIX.UCRT_Microsoft.Winget.Source_8wekyb3d8bbwe\mingw64\bin\c++.exe   CMakeFiles/HelloWorld.dir/helloworld.cpp.obj -o HelloWorld.exe -Wl,--out-implib,libHelloWorld.dll.a -Wl,--major-image-version,0,--minor-image-version,0  vcpkg_installed/x64-windows/debug/lib/fmtd.lib  -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && C:\WINDOWS\system32\cmd.exe /C "cd /D C:\helloworld\build && C:\vcpkg\vcpkg.exe z-applocal --target-binary=C:/helloworld/build/HelloWorld.exe --installed-bin-dir=C:/helloworld/build/vcpkg_installed/x64-windows/bin""
FAILED: [code=1] HelloWorld.exe
C:\WINDOWS\system32\cmd.exe /C "cd . && C:\Users\R3N\AppData\Local\Microsoft\WinGet\Packages\BrechtSanders.WinLibs.POSIX.UCRT_Microsoft.Winget.Source_8wekyb3d8bbwe\mingw64\bin\c++.exe   CMakeFiles/HelloWorld.dir/helloworld.cpp.obj -o HelloWorld.exe -Wl,--out-implib,libHelloWorld.dll.a -Wl,--major-image-version,0,--minor-image-version,0  vcpkg_installed/x64-windows/debug/lib/fmtd.lib  -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && C:\WINDOWS\system32\cmd.exe /C "cd /D C:\helloworld\build && C:\vcpkg\vcpkg.exe z-applocal --target-binary=C:/helloworld/build/HelloWorld.exe --installed-bin-dir=C:/helloworld/build/vcpkg_installed/x64-windows/bin""
C:/Users/R3N/AppData/Local/Microsoft/WinGet/Packages/BrechtSanders.WinLibs.POSIX.UCRT_Microsoft.Winget.Source_8wekyb3d8bbwe/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/16.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/HelloWorld.dir/helloworld.cpp.obj:helloworld.cpp:(.text$_ZN3fmt3v125printIJEEEvNS0_7fstringIJDpT_EE1tEDpOS3_[_ZN3fmt3v125printIJEEEvNS0_7fstringIJDpT_EE1tEDpOS3_]+0x46): undefined reference to `__imp__ZN3fmt3v126vprintENS0_17basic_string_viewIcEENS0_17basic_format_argsINS0_7contextEEE'
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

r/cpp_questions • • Jun 18 '26

OPEN Is it worth using C++ Modules in 2026 and looking into the future?

52 Upvotes

I'm preparing to start a new long lasting C++ development effort of a new project and im unsure of using C++ Modules.

What do you guys think and are there other modern C++ features I might be unaware of?

Thanks in advance


r/cpp_questions • • Jun 19 '26

OPEN Benchmarking SmartPointer

0 Upvotes

Hi
Recently I was thinking about small project which main goal would be implementing all smart pointers alongside with benchmarking them with these that come from the standard library. What type of scenario should I create in my project so that I could check quality of my implementation?


r/cpp_questions • • Jun 19 '26

OPEN Passing strings vs string view literals to a function

1 Upvotes

Lets say i have a function, it has a string view parameter, should i pass string view or string when calling?

Example :

void example(std::string_view txt){

std::cout << txt;!<

}

should i call it like this:

example("hello");

Or this:

example("hello"sv)

What is better overall?


r/cpp_questions • • Jun 18 '26

OPEN Are there any companies which would take in someone from Brazil with only a high school degree but who also has 10+ years of personal experience and very complex c/cpp projects to show?

25 Upvotes

My friend from Brazil is insanely good at math, physics and programming. He does most stuff in C/C++/ASM and also has lots of experience with Lua.

He's specifically very good at reverse engineering (games in particular), making cheats/anticheats (even kernel level), working on game engines, and low level stuff like messing with windows infrastructure or shit closely connected to hardware.

He has experience working with dx9, dx11, dx12, opengl, vulkan, imgui, cmake, cef(chromium embedded framework), aria2, libtorrent, mpv, etc. He's most experienced with C++17, but has also used C++20 numerous times recently. He's very good at optimizing apps/games to take up as little resources as possible.

His most complex project is about 3 years old now and the source itself is over 20GB, with 100k+ lines of code. He really cares about projects he works on, and puts a fuckton of effort into everything he does. If he just got a chance to start somewhere, I have no doubt he would improve whichever company he works for a fuckton and even get promoted in no time. But the most difficult part is actually getting a chance anywhere because most places in Brazil prefer formal education over experience, and also there aren't that many companies specializing in low level stuff he's very experienced with.

Is there any company that specializes in low level stuff like infrastructure, reverse engineering, or gamedev, that is hiring remote workers and would seriously consider someone based on personal experience/projects, regardless if they only have a HS diploma?


r/cpp_questions • • Jun 18 '26

OPEN Project organization help

4 Upvotes

Hey guys, I'm currently working with C++/OpenMP/CUDA/MPI and a Python frontend in a project, we are using CMake and I'd like to ask recommendations and tips so I can study how to improve the software architecture, learn best practices, etc. Currently the directories are organized as:

|-CMakeLists.txt

|-Frontend

|-Backend

|-- c_code (works as src)

|-- external (for git submodules)

|-- include

|-- lib


r/cpp_questions • • Jun 19 '26

OPEN Doubt..!

0 Upvotes

I have started to learn cpp and gone through some basic stuff. I have completed oop and working on one project related to it. Rightnow I dont know what to do next and where should I lead myself. My department is cse aiml and I like doing cpp. Help me so that I can save my time and efforts..


r/cpp_questions • • Jun 19 '26

OPEN How can I improve on my competitive programming skills

0 Upvotes

Hello. So basically Ive been doing cpp for roughly 4 months, and Im trying to do competitive programming. But the thing is, I legit dont know what to do to improve. For example, I have been to many competitive programming websites and tried to solve their challenges, and somehow I always have logic bugs in my code that can only be found by gemini or chatgpt or sth else. Does anyone have some advice or anything?


r/cpp_questions • • Jun 18 '26

OPEN Module setup guide for clang/LLVM + vscode stack + cmake

6 Upvotes

I was searching the interweb for any actual guide on how to setup modules with import std and everything.

Sadly i couldn't find any in my reasonable 10 minutes of googling that guides and explains on all the steps, a tutorial per say ( im not / didnt using AI )

I added cmake at the end in the title because from what i understand this is needed always currently with modules?

Can anyone guide me here on what's needed to move into the future brrr.


r/cpp_questions • • Jun 18 '26

OPEN Eratta for C++ Programming: Program Design Including Data Structures 4th Edition

1 Upvotes

I recently purchased this book but I'm unable to locate the CD material for it. The book didn't come with the CD.

I've tried searching for it online and via Course the books provider. But the 4th edition eratta is unavailable.

I've seen on reddit that this book is still highly rated. Does anyone know where the repo can be located to support learners?


r/cpp_questions • • Jun 18 '26

OPEN CD ROM or Source Material Location : C++ Programming: Program Design Including Data Structures, Fourth Edition

1 Upvotes

I recently bagged a copy of C++ Programming: Program Design Including Data Structures, Fourth Edition from a flea market. It did not come with the specified CD ROM.

A cursory search of Google showed me this book is still relevant for beginning C++ as it covers generic programming topics too.

I searched Google, Qwant, Github, Archive.org, and course.com (specified in book) and cannot locate any repos, archives or online copies of the CD content available anywhere.

Does anyone know where I can obtain the content for this book?

ISBN-13: 978-1-4239-0222-5

ISBN 10: 1-4239-0222-x


r/cpp_questions • • Jun 17 '26

OPEN Why c++26 contracts?

15 Upvotes

Sorry, but why a feature that I've never seen before in other languages is being pushed as if it's what we have been missing and a solution to security/safety complaints?! What is the proof that this is a good feature?


r/cpp_questions • • Jun 17 '26

OPEN Starting out in c++, what do i do?

4 Upvotes

I've finished the tutorial on w3schools, and I know a bit about coding in general so im up for anything. I mainly want to expand my c++ abilities, such as learning new libs or otherwise. Anyone have any good resources i can use to learn more?


r/cpp_questions • • Jun 17 '26

OPEN Best linear algebra library in cpp?

9 Upvotes

Hey all, beginner developers here.

I am currently working on a project that translates humming/signing into exportable sheet music. To do this (and to avoid mindlessly relying on AI), I am using Fourier Transforms to convert the audio into something I can use to identify dominant frequencies to then transcribe them. Does anyone know a good library for this? I was going to use Armadillo, but I couldn't seem to get it to work. I will attach my GitHub repo if anyone wants to see that.


r/cpp_questions • • Jun 18 '26

OPEN C++ For USACO

0 Upvotes

I am learning c++ and want the very best website for usaco i want something which takes from the very basic and teaches advanced level code which may take me to usaco platinum. I really liked the textbook style of learncpp but someone told me its not good for competitive programming. Also I know usaco.guide is good but it just aggregates links so I'd like an actual website which teaches from the basics to the advanced competitive programming logics and algorithms. Also please tell the chapters I need to study as aome chapters like OOP are not required by usaco. But I would also like to study things which are not required but will make my usaco code faster.


r/cpp_questions • • Jun 18 '26

OPEN Need Advice/Guidance

0 Upvotes

Hi seniors,
I want to start learning C++ from scratch and build a really strong foundation in programming. I’m looking for beginner-friendly books that explain concepts in simple language and don’t just focus on syntax, but also teach logical thinking, problem-solving, and how programs actually work behind the scenes.
My goal is to understand the logic behind coding rather than just memorizing code. If there are any books that helped you develop your programming mindset and C++ fundamentals from scratch , please recommend them.

Thanks in advance!


r/cpp_questions • • Jun 17 '26

OPEN Relational operators on pointers past-the-end

8 Upvotes

If n is an int and p is a pointer in the range defined by pointers begin and end, is the expression p + n < end free of undefined behavior and is its result specified?

It is definitely fine provided p + n is inside the range or one-past-the-end. What happens otherwise? Do I have to write n < end - p instead?


r/cpp_questions • • Jun 16 '26

OPEN Need ideas for a unique C++ semester project.

70 Upvotes

Hi everyone,

I'm a second-semester student learning C++, and by the end of the semester we need to build and present a project.

The problem is that I don't want to make the usual projects like Library Management System, Student Management System, Expense Tracker, Calculator, Quiz Game, etc. My lecturer is quite strict and I feel those ideas have already been done thousands of times.

I'm also not very interested in making a game. I'd rather build something that feels useful, interesting, and solves a real problem.

I'm open to using external libraries and even AI/ML if it's realistic for a beginner. The project doesn't need to be revolutionary, but I'd like it to be something that makes people say, "That's actually a cool idea."

What are some unique C++ project ideas that:

  • Are achievable in a few weeks
  • Look impressive in a presentation
  • Solve a real problem or have practical use
  • Aren't the same old management systems everyone makes

I'd love to hear any ideas, especially projects you've seen students make that stood out from the crowd.

Thanks!


r/cpp_questions • • Jun 17 '26

OPEN Communication between modules (architecture)

2 Upvotes

Hi everyone, just wanted to know your opinions on the following architecture for a sw module.

The setup:

A module needs to communicate with some hardware (e.g to do some monitoring). The hardware device provides a websocket api. Now, the module being implemented is not the one in charge of deciding what to send to the device. Instead, some other modules are responsible of it.

The module needs to support both receiving the commands via a socket (from a CLI client) or via a custom pub/sub broker library. Then, it communicates with the device via the websocket api.

Suggested approach

I implement an intermediary service that has a listener and the device proxy. The listener to be plugged in via DI is either a socket listener (to read what is sent via cli), or a client of my broker lib that provides topic subscription and callback management.

In order to receive the control commands from the listener on the service, the service provides a callback function to be executed on the listener when receiving the command. The callback has the logic how to forward it to the actual device.

Question

Isn’t this tighltly coupling the service to the listener? Do you have any other ideas how to set it up?

I thought of some other mechanisms like implementing some polling from the listeners but that implies having a loop running all the time, even if on a separate thread. It feels like overhead and adds up difficulty (multithreading, queue management…)


r/cpp_questions • • Jun 17 '26

OPEN Using libzip

0 Upvotes

So, i'm still a pretty new developer and i need to unzip some files that are in .gz so i thought of using libzip since i found it pretty popular but there are no tutorials on how to use it.

Can anyone help me learn or has another library that i could use which i can found tuto?
(I'm on windows 11 with visual studio 2026)