Category "c++"

How to call a mvsc dll (C++ or Rust) from Progress Open Edge

I have a dll that i want to call from Progress code but I can't complete. I have tried with Visual Studio 2022, Windows C++ Dll and Rust Dll. Windows C++, Visua

Deribit FIX API Logon

Following code doesn't seem to work to Logon using FIX API. Getting "invalid credentials" from the exchange though same username and access key seem to work wit

Narrowing conversion on a (int64_t * static_cast<float>(double))

I'm fixing some lint errors in a codebase I am working with, and I see the following line // note offset is int64_t, scale is int64_t, x is double int64_t y = o

error: new initializer expression list treated as compound expression [-fpermissive]

I am trying to write a playlist method for songs in c++, however, I keep running into frequent errors. template <typename T> struct cir_list_node {

Counting how many decision variables are equal

I'm a beginner user of Google OR-Tools, especially the CP-SAT. I'm using version 9.3, and I'm interested in the C++ version. I'm modeling a problem where I need

C++ Vector returning odd output for last iteration?

I am attempting to figure out the Skyline problem to better understand C++, right now I am learning more about how I can use vectors. I am trying to iterate thr

How to test a singleton generic template to be thread safe?

How do I make Singleton generic template, and how can I test it? Right now I am interested in seeing with my own eyes that 2 threads that invoke get_instance()

MQTT message is not received because of object in object

Libraries: <PubSubClient.h> <ESP8266WiFi.h> "ArduinoJson.h" When I send this JSON, the message is received and I can do things with it: {"topic":"d

MulVAL: make[1]: *** [Makefile:4: attack_graph] Error 1

I'm trying to compile MulVal, everything is already setup tried all of the solutions, getting this error, don't know if it was from the compiler or the code it

Garry's Mod: How to send a DLL?

Garry's Mod provides a C++ API to create server-side and client-side DLLs. As it is said in the article "Creating Binary Modules", they must be placed in the "g

How to make this code faster in python (algorithm question)

Today I was browsing for some questions that I saw this: Algorithm - Air Battle C ++ time limit: 1 second Java time limit: 2 seconds Python time limit: 10 secon

Different values for integer

Trying to insert values of square and cube of a number in set st and st1. (Let n = 10^7). After printing, set st is having negative values due to limit of integ

Using 'memcpy()' inside a class with a union

I have a class foo that manages data using small buffer optimization (SBO). When size < 16, the data is held locally (in buffer), otherwise it is stored on t

C++ {fmt} library: Is there a way to format repeated format fields?

I have a program with many formatted write statements that I'm using the fmt library for. Some of them have many fields, say 100 for example purposes, something

Why do std::shared_ptr<void> work

I found some code using std::shared_ptr to perform arbitrary cleanup at shutdown. At first I thought this code could not possibly work, but then I tried the fol

clang-14: warning: cannot compress debug sections (zlib not installed) [-Wdebug-compression-unavailable] while using address sanitizer

I have a sample C++ program that would cause an obvious segmentation fault. test.cxx: int main() { int* ptr{nullptr}; *ptr = 3; } So I am using address san

Coroutines are not distributed over asio::thread_pool threads

I wanted to try out to c++20 coroutines together with asio. In a simple test three are coroutines which would be executed on a asio::thread_pool with 4 threads.

How to structure data without bloating the size because of alignment?

Lets say we have a struct Original as this: class Original { int x; bool y; bool z; }; Due to alignment, the sizeof(Original) is 8 bytes. 4 for the int,

How to find the center and radius of an any dimensional sphere giving dims+1 points

given a vector of N-dimensional points. The vector will be of size N+1. Is there a generalized algorithm to find the center and radius of the ND sphere using th

Debugging NASM in VS code

I have a simple C++ program that calls some NASM code: main.cpp: #include <iostream> extern "C" int foo(); int main() { std::cout << "The result