Category "c++"

Unable to refer to typedef struct definitions done in Win32 Header files (.h files in External dependencies) from WinRT C++ Library

Unable to refer to typedef struct definitions done in Win32 Header files (.h files in External dependencies) when consumed from WinRT C++ Library #include <m

Random access of a linked list element

In an article about linked list, it is said that accessing a random element is not allowed and to access a certain node we need to traverse it from the head nod

Why glBufferSubData is slow?

When trying to access GL_ARRAY_BUFFER using glBufferSubData to 128 byte buffer size, accessing takes at worst 200 microseconds. Instead when allocating whole bu

Neatly linking dependency tuple references specified by variadic class args

Given the following class structure in which we possess a number of different classes C#, each with unique data that is passed into a number of ledgers L<C#&

How to add more than one header(HDRs) and object in a makefile?

HDRS = EventLoop.h Data.h OBJS = EventLoop.o Data.o dict_$(PROGRAM).o This is from my makefile, I want to add another Data.h and Data.o in it , kindly help! Tri

Ambiguous overload error when using conversion function

I am trying to understand overloading resolution in C++ through the books listed here. One such example that i wrote to clear my concepts whose output i am unab

Rewrite a C++ vector to java vector

My task is to migrate a code from C++ to Java. In the C++ there is a vector called vector1 with the following code: vector1[0].insert(vector1[0].begin(), to_str

Write a macro function to change the case of a string?

// I tried this code #include<iostream> using namespace std; // Function to convert characters // of a string to opposite case #define case_change(s

Why is Signed Overflow due to computation still Undefined Behavior in C++20

I came to know through this answer that: Signed overflow due to computation is still undefined behavior in C++20 while Signed overflow due to conversion is wel

How do you declare a stack of type struct? in c++

In the code below, how do you properly declare a stack of type struct and push strings onto the stack so that they are saved in the struct? How do you specify w

Copying assets directory from source to build directory in CMake

I am trying to write a game for practice in C++. I am using CMake for this, and my project gets built in a separate build directory automatically by my IDE. How

Hikvision IP PTZ camera control with LabVIEW

I want to control hikvision camera with LabVIEW. By using the "NET_DVR_RealPlay_V30" function of the "HCNETSDK.dll" file compiled with C/C++ with "Call Library

Problem with deprecated conversion from cv::mat to IplImage

I know there were already questions like this in the past but all the answers seem not to work anymore since some functions are deprecated so I hope you can hel

How to watch instance method operator() result in VSCode C++?

My code is as follows: class Foo{ public: int operator()(int i) { return 1; } int operator++(int i) { return 1; } }

Need help to solve error in drawing histogram in root

this is my code I am checked it many times but it gives me an error when I run it. TFile *f=new TFile("hist.root"); TH1F *h = (TH1F*)f->Get("Phi_mu"

Why are the results of the optimization on aliasing different for char* and std::string&?

void f1(int* count, char* str) { for (int i = 0; i < *count; ++i) str[i] = 0; } void f2(int* count, char8_t* str) { for (int i = 0; i < *count; ++i)

C++: array<> too many initializers

The following code is returning the compilation error below. I'm stuck understanding how there are too many initializers. This code works using vector<X>

grpc can't find protobuf library

I went over the grpc installation and finished building and installation. Now when I try to: find_package(gRPC CONFIG REQUIRED) I get CMake Error at CMakeLi

Retrieve always latest messages from Kafka on reconnection

I'm writing a piece of code that needs to read hundreds of messages from Kafka each few milliseconds. I'm using C++ and librdkafka. When my program stops and th

Video Lagging while Object Detection on C++

There is an object detection pre-trained model i.e. Yolov3/v4-tiny, when the algorithm is implemented in python, everything looked good, there is no lag while p