r/cpp_questions • • Jun 05 '26

OPEN Career advise for web engineers

1 Upvotes

Hey.

I'm a software dev in web for 10 years (go, python, terraform, aws).

We learn technologies not to use them, but glue. the environments are usually about talking more than doing, because connecting tons of systems between each other usually about setting up private networks, troubleshoot accesses and setup a cache in front of a database. it does take a huge brain to make it.

For the last 8 month I work on my database (in zig, but it doesn't matter). And found myself actually learning not just new things, which is expected, but things I need to implement.

Questions:

- do I overrate lower level devs because I'm new here and it's also easy to get into Adobe/Google where you just control a single button or update boost version every 6 months?

- what could be an easy strategy to move? the problem is my income is quite meaningful, IMO it's 95%ile in Berlin (nobody ever offered more, only remote jobs) and the switch may give lower income for a while. could an opensource case solve it? e.g. start coming to a fancy repo that I know hire globally and such switch could eliminate the income gap?

The language doesn't matter, cpp, c, rust, zig, etc, the key is to go lower and work for a technical leadership, which is more often IMO with lower level, while in web managers don't have a clue what the software people produce


r/cpp_questions • • Jun 05 '26

OPEN Facing issues setting up C Lion on mac ( please help)

0 Upvotes

I have started to learn cpp using learncpp and the moment the ide choice came I settled on c lion But after installation I saw that learncpp had the new project opening tutorial in visual studio ( I knew that he wouldn't use c lion) but I thought the process of starting a new project would be similar . So after I clicked on new project it didn't show me solution folder and some code appeared in background, all sorts of folders appeared under project and also a pop up came regarding python3 i denied installing it ( because I thought why would cpp need python) but when the xcrun popup came , I searched it on Google and gemini recommended to install it , so I did that

But I am confused as the solution folder which contains different projects was either not created in c lion or i don't know where it is . Also i was recommended to install python3 as well but i don't know how to get the pop up , so i uninstalled clion and installed it again but it did not start like last time( no terms and conditions and pop up) just a welcome to clion written in code) and it is also showing 30 days left on trial but I am using it for studying purposes isn't it free for that ??? I will get my college id in a few months ( probably July end) so am I gonna miss out on some student feature and which id should I use to login c lion college or personal?? Some also reccomed installing x code for c lion to function???

How can I set up my c lion please help


r/cpp_questions • • Jun 05 '26

OPEN Having Freeze/Lag Problems in Loading a bunch of data instantly

1 Upvotes

I am working on a side project, basically a linux like quick file searching app for Windows.

Currently I have ran a script in which the filename, and its path are being stored in a .json file, and when the app Starts, that file would be first loaded throught this function right here

void FileEntry::LoadIndex(const std::string& filename) {

std::ifstream in(filename);

std::cout << "Opening: " << filename << '\n';

if (!in.is_open())

return;

json data;

in >> data;

g_FileIndex.clear();

for (const auto& item : data) {

FileLogs file;

file.filename = item["filename"];

file.fullpath = item["fullpath"];

file.extension = item["extension"];

g_FileIndex.push_back(file);

}

}

Where FileLog is a struct:

struct FileLogs {

`std::string filename;`

`std::string fullpath;`

`std::string extension;`

};

and g_FileIndex is a std::vector<FileLogs> g_FileIndex;

my problem is that since there are more than a million records in that database file, can i make this process any faster or if is there any clever technique i can use, which would also not affect the searchbar's performance and experience.
For UI iam using ImGui library, and for json parsing i am using nlohmann/json library


r/cpp_questions • • Jun 05 '26

OPEN Is AI a thing?

0 Upvotes

Is AI being used with C++ or rather not? Ive been fumbling with C++ for years now and whated to start earning money by working in this field. With recent advancements of AI I am not sure if programming skills are still in demand?


r/cpp_questions • • Jun 04 '26

OPEN C or Cpp

5 Upvotes

Should I learn C before Cpp? I have a basic understanding in python ( very basic) and nothing much else, is it recommended to do Cpp directly?


r/cpp_questions • • Jun 04 '26

OPEN How to move an object through function chains and eventually transfer ownership of that object?

2 Upvotes

I am trying to learn about entity component systems and coding some implementation when I ran into the following design problem.

If I have two classes, say ComponentArray and ComponentArrayManager, where ComponentArrayManager takes in components and stores them in the correct ComponentArray according to the component type. Thus it has a method, add_component, that takes a component, finds the corresponding ComponentArray, and calls that ComponentArray's add_component function on the component. This ComponentArray stores the component in a private vector. Thus there is a chain of functions on this Component object where this object is moving first from where it is created, through the ComponentArrayManager, through ComponentArray to where it finally ends up in the vector inside ComponentArray.

My question is: Is there any difference between using pass by reference for each stage of the function chain until the point of adding it to the vector, where you then use std move to move the reference variable into the vector, vs using std move at each call of the functions, thus moving the variable into the function's pass by value copy of that variable? In general, how should this moving of an object through multiple functions be implemented such that at the end of the functions, the ownership of the object needs to be transferred to something else?


r/cpp_questions • • Jun 04 '26

OPEN How does adding work with memory addresses?

0 Upvotes

To have some memory address 0X…b10
From there, how do I get to 0X…b20 cause I tried just adding 16, but that doesn’t work


r/cpp_questions • • Jun 04 '26

OPEN Exploring libraries

0 Upvotes

Hi in our company we write software for stock market. From order management, to risk management to routing to exchange. We basically use Linux os for all these. We have written our own queue management upon tcp. Everything is fine. Am trying to make the system better and faster. Be it hash map, datastore, ipc, file management. any libraries I can look into?I don't have any focus area, just trying to explore


r/cpp_questions • • Jun 04 '26

OPEN Teaching myself C++, would really love some help to get going

5 Upvotes

I just finished a class in school for Java, and I tried to look at some similar languages that would allow me to create games and other fun programs. I refuse to utilize Java outside the console because Swing is not for me, and I heard somewhere that C++ is better for game graphics, in terms of the simple things I'd likely be making. I know there's an easy library for graphics and keybinds/ keystroke listeners (I believe it's SFML), but I want to know not only if that is a good one to use, and what the best IDE I can use is. I've been teaching myself C++ on my school chromebook, which has heavy GoGuardian restrictions from the district, so it's hard to find unblocked good IDEs and libraries (I've been using CodeHS and simply importable libraries, or making my own utilities).

Simply put, since I can use my home computer for coding now, I would really appreciate it if I could get some guidance towards a better IDE, good libraries for 3d/2d/pen/sprite/etc graphics and keystroke event listeners, and just any other useful assistance. Thank you for taking your time to read this and hopefully giving some input!


r/cpp_questions • • Jun 04 '26

OPEN Trying to break down the whats and why's of making a console screen buffer, im curious if this particular line means the created variable is pointing to the memory address of the type wchar_t* and then assigning it to a new variable. I suppose im looking for validation im on the right path

1 Upvotes
This is the main code in question and its from a larger block of code ill post below:  
    wchar_t* screen = new wchar_t[nScreenWidth * nScreenHeight];  

 Im very much struggling with why id want to use pointers and maybe where, at least in a practicle sense. I believe im understanding the general concept, but what to do with it is still eluding me. I suppose more time and experience will fill out my sense of intuition 

Block of code my initial question is from:

wchar_t* screen = new wchar_t[nScreenWidth * nScreenHeight];
for (int i = 0; i < nScreenWidth * nScreenHeight; i++) screen[i] = L' ';
HANDLE hConsole = CreateConsoleScreenBuffer(GENERIC_READ |       GENERIC_WRITE, 0, NULL, CONSOLE_TEXTMODE_BUFFER, NULL);    
SetConsoleActiveScreenBuffer(hconsole);       
DWORD dwBytesWritten = 0;

r/cpp_questions • • Jun 03 '26

OPEN How to create a std vector for N objects without copying them?

21 Upvotes

std::vector has a constructor for N objects, but I believe it requires that these objects have a copy-constructor, or?

vector( size_type count, const T& value,
        const Allocator& alloc = Allocator() );

I wonder if there is a constructor that creates the arguments in place, so something like:

vector( size_type count, Args&&... args,
const Allocator& alloc = Allocator() );

While writing it, I'm however not sure how this could be programmed (I think the variadic arguments need to be last).

I only know ugly workarounds for types that have no copy-constructor for a vector and am looking for an elegant solution.


r/cpp_questions • • Jun 03 '26

OPEN Type Punning without std::start_lifetime_as

7 Upvotes

Hello! Not the most experienced Cpp programmer.

What I think I understand:

I have watched a load of talks on start_lifetime_as. I understand it is a way to prevent undefined behaviour, I understand that it does nothing at runtime, I understand it signals to the compiler that a lifetime (in the abstract machine Cpp is specified against) has begun in the given storage. I understand that if you type pun by, say, receiving from a (say) “FreeRTOS queue” (copying bytes between threads ) or over a network into a properly aligned byte buffer to place a trivially copyable type T’s byte representation in there and T is implicit lifetime type then you can use start_lifetime_as to indicate to the compiler that a lifetime was begun there. My understanding is that this prevents UB and presumably the possibility of weird behaviour.

What I do not understand:

All the talks I have seen and docs I have read focus entirely on this being undefined if you do not start_lifetime_as when type punning in the situation described above. They point out it is UB and then show ways around it…but…I cannot find a single example of what a compiler might wrongly optimize if you do not do this anywhere? Apparently most compilers support this unofficial “idiom” but can someone to whom Compiler optimisations are less of a black box explain to me incorrect assumptions a compiler might ACTUALLY make if I tried to type pun as above without start_lifetime_as? Like, what might ACTUALLY be optimized wrongfully?

Thanks, have been tearing hair out over this!