Category "c++"

Azure IoT Edge C++ module not sending device to cloud telemetry

I have written an IoT Edge C++ module that is sending the event output using the following function call: bool IoTEdgeClient::sendMessageAsync(std::string messa

(solved) C++ Load one Shared Object with dependencies and access their functions

OS Linux Ubuntu 18.04, gcc 7.4.0 A program should load one SO which is dependent on other SOs. All exported functions of all SOs should be called by the program

In C++, how can one map between enum values and data types, so the types can be used in templates?

How can one do this, which is obviously impossible C++, in real C++?: Type decodeUiEnum(UiEnum myEnum) { // impossible: cannot return a data type // one sw

Icons resources dont work in small and list sizes

Have created project on c++ in Visual Studio. Have added resources.rc + .ico file, that have next positions: 32 bits: 64x64, 48x48, 40x40, 32x32,24x24, 20x20, 1

It is legal this approach for create a local variable in C++

I'm new to C++ and try to understand how to create and use a class in C++. For this I have the following code: class MyClass { public: MyClass() {

How to convert virtual key code to character code?

In the onkeydown() handler I am getting 219 as the keycode for '['; however, the actual character value of '[' is 91. Is there any way to map these two?

Screen turns black & can't interact with it, after C++ program runs a period of time

I'm running a C++ program that uses backtracking and writes solutions in a text file. If the solution's set of elements is long enough, it will take enough time

Unresolve external symbols when using v8.dll in my project

I'm new to making C++ project. I may be not sure prerequisite knowledge of C++ project. [My environment] Windows 10 Python 2.7.18 Developer Command Prompt for V

How do I access individual lines in a string? (updated once again / with more detail)

I am updating this again because I am utterly lost, I apologize. I think I can more clearly word it now after trying this solutions, so here goes: Say I have a

Better approach to integrate multiple types of Interfaces

I have, say, two devices. class Device1{ public: int GetData(){ //... } }; class Device2{ public: bool GetData(){ //... } }; I have a a C# sty

Inversion count gives error on large inputs

The given code is for counting the inversions in the given array or we can say to count the number of changes to be made in an array so that it becomes sorted.

Why there is a delay in running a console application just created?

I have noticed this for a while. After building a cpp console application, when i run it through command prompt, the first time it takes some time to run. The s

E-olymp: Profit. 90% gives, one test wrong answer

Description of my code: For example, take n = 3, and let p [i] be 1 2 3. For beginnings, max = 0. I take in this order the sequences: 1, 1 + 2, 1 + 2 + 3, 2, 2

Object Oriented Programming - Inheritance C++, Code does not compile

Source Code #include <iostream> using namespace std; class A { private: long int a; public: long int b,x; void s

VSCode C/C++ IntelliSense ignore patterns for includePath and browse.path

Is there a feature in VSCode IntelliSense that allows to ignore specific header files for includePath and browse.path settings? In my case I have a CMake based

An incomprehensible error in Qt6. Can't init 2 QMap

I'm trying to create a class in Qt6, but i can't. I'm writting in tunnel.h: QMap<quint64, QMap<quint64, QByteArray>> *storage = new QMap<quint64,

Segfault 11 when invoking python callback from c/cpp library

I am running a UDP socket from a c/cpp library and passing in a callback from python. The callback runs fine, until I attempt to modify a member variable of the

Which GCC optimization flags affect binary size the most?

I am developing a C++ for ARM using GCC. I have ran into an issue where, I no optimizations are enabled, I am unable to create a binary (ELF) for my code becau

How to access FlexLexer's input function without deriving from yyFlexLexer?

I am writing a simple compiler for a simple C like language. To do that I would like to use Flex and Bison but use them both in the context of modern C++ Right

Problem: Assigning a group number to elements near eachother where groups are separated from spaces

We have a room divided of 6x5 possible seats, every place in the 6x5 matrix could be a seat or could be empty. We have the Matrix with all the seats already ass