Category "c++"

Integer literal for fixed width integer types

Is there some c++ proposal for Integer literal for fixed width integer types like this? // i's type is unsigned int auto i = 10u; // j's type is uint32_t auto j

How to make use of SIMD capability for sum of squared differences between 8-bit components of RGBA pixels?

The below code is trying to extract the red, green and blue channel of a pixel value and performing an arithmetic with another set of RGB values. It seems that

why run program with boost::process::spawn with modifed PATH environment failed?

the code as follow: #include <boost/process.hpp> #include <iostream> int main() { // cmd // std::string cmd{"g++.exe"}; // ok std::str

Determining the scrollbar movement in MFC

In my application, I use two scrollbars and handle the movement of the slider in them using the function: afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrol

how can I stop the song in the buzzer when there is a bright light coming in ldr sensor?

I tried doing the if else statement for the buzzer. But it finishes the song code first before the else statement runs. I tried running the code and it starts t

How to call swap() algorithm on std::list elements?

I'm trying to swap the 2nd and 4th elements in a list, but I can't figure out how to do this. I tried to use vector notation, but it didn't work. list<int>

undefined reference to `vtable for Class` in destructor

im trying to build a simple element character type game in c++. Having an abstract class Personaje and a child class called Agua. Im having an error for undefin

How to let user write into the file in c++ using put() function?

I'm writing a c++ program to open a file with the user-defined file name. And then using the put() function to let the user write into the file until a newline

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