Category "c++"

Build error in Qt Creator in release but not in debug

I'm working with Qt 5.15.2 in Qt Creator 6.0.2. I have a program that uses a .lib file which was built in both debug (_ITERATOR_DEBUG_LEVEL = 0) and release (_I

How can I check whether a function is extern-C?

In C++, can I check whether a certain function has been declared "extern C" or not? I don't mind checks restricted to the current translation unit. I'd like to

How to implement sending a heartbeat message using a boost beast websocket client

I need to implement sending a heartbeat message to a third party server with regular intervals. The server uses these heartbeat messages to determine if that th

[C++][ QT ] is not meant to be copied. Pass it by move instead

I am a beginner in C++. And I don't understand this error. I just need you to explain me. I try to show a .sqlite database in a QTableview. The problem come fro

I can't see warnings/ runtime errors in VSCODE C++

I used to work in visual studio a lot but for competitive programming I switched to VS-CODE because it is faster and I have special extensions. But I have some

C# how to get an array of int* from unmanaged C++

On the unmanaged side I have short* m_pLevels[4], I need to get this array of pointers to the C# side so I can then use each point to copy from the unmanaged si

Second call to glDrawElements() takes 1.8 seconds in debug or release

The first frame takes forever to render, and I've narrowed it down to my second call to glDrawElements(). How weird. Here's the relevant code, obnoxious logging

How me get acces ui from another class?

I have a database in a separate widget class datbase.ui that I insert as tab in mainwindow.ui. I want that when initializing the connection in the class datbase

visual studio can't apply clang-format 13

I'm expecting to use AlignArrayOfStructures, however it's only available in clang-format 13. So I set Custom clang-format.exe to C:/Program Files/LLVM/bin/clang

Problem in building AWS SDK C++ EC2 library

i have a problem in building the aws c++ sdk Ec2 library on linux. I followed the steps bellow: git clone --recurse-submodules https://github.com/aws/aws-sdk-cp

Boolean function returning 24, and acting inconsistent across multiple compilers

Alright, this is driving me nuts and I have no idea what's going on. I have some code I'm making for school that basically takes in a string and a start and end

Is seastar::thread a stackful coroutine?

Seastar allows writing such code, by using a seastar::thread object which comes with its own stack. The seastar::thread allocates a 128KB stack, and runs the g

C++ Union Array differs in 32/64 bits

My code: union FIELD { int n; char c; const char *s; FIELD(){} FIELD(int v){ n = v; } FIELD(char v){ c = v; } FIELD(const char* v){

MQTT client waits indefinitely during publish of message

I try to implement an asynchronous MQTT client with the paho library, that receives messages on topic "request", formulates a string and puts the response out o

c++ queue implementation not working as expected

Today I am looking to make my own dequeue in c ++ using pointers. Well, in the program, I want to create two dequeues in which to add different elements. Unfort

CGBN: How to send to device memory short cgbn_mem_t, but make calculations over long cgbn_mem_t?

I'm somewhat lost on the point of converting, for instance, cgbn_mem_t<256> into cgbn_mem_t<1024> in device code. Say, the kernel receives two point

How can I call out a string from an object array?

I have recently started some OOP in C++, and I was trying to make a small program in Dev-C++ to store arrays of information on employees through a friends funct

How to reserve memory space for std::vector in terms of bytes?

I am trying to write up a config parser class in c++. I'll first give a snippet of my class: class foo{ private: struct st{ std::vector<pair<s

How do I add numbers into an array from a loop that creates random numbers in C++?

How do I add numbers into an array from a loop that creates random numbers? I also need to sort these numbers in a certain way. The next number cannot be greate

C++ call to API function ::GetTickCount() jumps ~18 days

On a few Windows computers I have seen that two, on each other following, calls to ::GetTickCount() returns a difference of 1610619236 ms (around 18 days). This