Category "c++"

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

Manipulating the standard output stream to print multiline strings horizontally

So I have three strings and these strings are supposed to occupy 3 lines. I thought this was a good way to represent my string: std::string str1 = "█π

Adding a node to the beginning of a double-linked list

I am trying to create a function that adds a node to the beginning of a double-linked list in C++, and I'm getting this error in Xcode. I know it must be becaus

incorrect output when using C++ lower/upper_bound function with custom compare operator

I've been experimenting with the "lower_bound()/upper_bound()" functions in C++ w.r.t. arrays/vectors, and I get incorrect results when applying custom compare

Deleting a pointer from a vector... Error: terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc

I'm getting the error after I delete a pointer from the vector and try to delete a second one. I'm still new to pointers I created a base class of shapes and ha

What is the fastest way to get the lowest set bit of a C++ std::bitset?

I noticed that std::bitset does not have a function for returning or popping the lowest set bit of a bitset (nor the highest set bit for that matter). What is t

Directshow Transform filter's implementation exposes data race? [solved]

I'm writing a transform filter in Directshow. I've looked at the Transform filter implementation. They use 1 filter_lock for protecting filter's state and anoth

Why is this texture displaying all black?

Here is the function where I am calling all of my draw operations. I also compile the shaders inline in the function. It displays the quad correctly when I just

How to access the files in the res folder in the imgui conan package?

I am using conan to handle dependencies, for those of you familiar with imgui, it provides a series of backends you can include. When you look at the conan pack