Category "c++"

asio How to change the executor inside an awaitable?

I have read this question and tried to replicate the answer with the following code: #include <iostream> #include <syncstream> #include <thread&g

How to hide a console in makefile

I am making something in Raylib C++ and every time I open the .exe file, the console and the raylib window opens up. How can stop/hide the console from opening

What is underlying data structure of std::deque and how does it's iterator work?

I know that std::deque has the different chunks of contiguous memory and iterator is invalidated by inserting or erasing the middle of deque. In addition to it,

Can't Print array with multiple data types

I created a struct named products that contains multiple data types: struct products{ int ID; string Name; double Price; int Quantity; }; Then

Why the code show "Debug Assertion Failed!" message? [duplicate]

I trying to make a C++ code that delete occurrences of an element if it occurs more than "n" times, when I debug the code, apears a window wit

Best HID device communication libary C++

I want to send bytes to a HID device. I've allready tried libhid but I can't get it to work. Does anyone know a libary or a easy way to send bytes via. HID in C

What serves the same purpose of Java volatile in C++?

I learned the volatile keyword in Java. It serves as a mean to ensure visibility in other threads when a variable is written by one particular thread. It does t

I have an issue with includePath

I have an error with inlcudePath here is what it says. #include errors detected. Please update your includePath. Squiggles are disabled for this translation uni

why am I getting segmentation fault instead of a garbage value output?

The following piece of code always gives garbage value as output. I am aware of the reasoning behind it as a dangling pointer is created which still points to t

LEMON Graph library: Inheritance in Maps

in my PhD project, I want to create a graph using LEMON. The graph itself is directed and hierarchical meaning that the graph has a tree-like shape. The leaves

When is the compiler allowed to optimize away a validity check of an enum or enum class type value in C++?

While searching for an answer to the question above, I came across the answer of Luke Kowald to the question Check if a value is defined in an C enum?. It state

Brace Initialize struct with virtual functions

Brace initialization struct A { int a; int b; void foo(){} }; A a{1, 2}; It works fine. Bu

c++, ffmpeg tanscoding: time_base differs depending on the container

I transcode video (mkv and mp4). When mkv transcoded to mkv, output is fine (output video fps and duration are same as input), but if mkv transcoded to mp4, out

How to open a second QMainWindow from my first/original MainWindow?

I am creating a desktop app with Qt6 and C++ and I have my original MainWindow class. Using Qt Creator I generated ui,h,cpp for a new SummaryClass (QMainWindow)

Is there a simpler way to write a concept that accepts a set of types?

Essentially, is there a shorter/cleaner way to define Alphabet than using a bunch of std::same_as/std::is_same? struct A {}; struct B {}; struct C {}; ... temp

I need a function to delete certain characters from a char array in c++ without using any index

for example: if the user enters : ( 23+22+43) I want the function to do exactly the following : for(int i =0; i <strlen(x);i ++) { if (x[i]=='+') {

How to open GStreamer pipeline in OpenCV

I'm a software engineer in South Korea. I'm trying to open webm video using GStreamer pipeline in opencv program But I can't find any solution to figure out it.

Use templates to implement a subset of multiple virtual methods of a templated class

I am working on incorporating a new implementation based on an older, fixed API and moving in somewhat contradicting terrain because I need to pair a templated

My checkTie() function is not working correctly

I am working on my college project where we have to create a Tic-Tac-Toe game and I am completely made the game but for some reason, my checkTie() function is n

find_package() ignores <PackageName>_ROOT

In my CMake script I append the path to a folder containing <PackageName>Config.cmake to <PackageName>_ROOT and then call find_package(<PackageNa