Category "c++"

Is this pointer always a runtime construct

I am learning about the this pointer in C++. And i came across the following statement from the standard: An expression e is a core constant expression unless

Add Serialize to SFML Color

I am working on serialization of color data for SFML objects and ran into an issue where they are not supported by default, as they are not a default type. I tr

how to get a list of available monitors in windows 10

I want to get a list of available monitors in Windows 10, same as the monitor list shown in the System display settings (no matter whether they are attached or

Get exit status of a process in bash

I have a c++ executable named Test. I want to find out the GetExitCodeProcess() code when the execution is completed. I can find out the status code by writin

Prevent window from being clicked in while another window is open

On Windows, when a window opens on top of another window, the parent window will not be clickable, and will make a "ding" sound and its titlebar will flash. It

Can't open .txt file after compiling with CMake

I'm on MacOS and I'm coding a C++ project using SDL2 containing a src file main.cpp, a spritesheet.png and a .txt file. They're all in the same "src" directory.

Visitor Pattern and std::shared_ptr

I am using the Visitor design pattern in my application for message processing. For example: class AbstractMessageVisitor; class AbstractMessage { public:

msvcrtd.lib(exe_main.obj) : error LNK2019: unresolved external symbol main referenced in function

I am using gradle to build my c++ library I added this line to build.gradle file linkTask.linkerArgs.add("msvcrt${linkTask.name.toLowerCase().contains('debug

generic decorators for callable objects with conditional return

I want to write decorator functions for callable objects. This is what I have now: #include <utility> template <typename DecoratedT, typename Callable

How fix "unresolved external symbol" during OpenCV building with "WITH_QT" flag on in Visual Studio 2019?

I want to build an OpenCV library with Qt support from the source with CMake and Visual Studio 2019. Here are steps I did: Downloaded both opencv-4.5.5 and open

QTableWidget with setItem cannot access the data in the tablewidget

void IdListForTrain::SetListIdInList(QStringList IdList) { QTableWidgetItem *item=nullptr; for(int index=0;index<IdList.count();index++) { ui->Id_tabl

How to instruct c++ compiler to automatically use SIMD instructions? [duplicate]

Let's say I have a generic c++ code based on c++ standard. This code is meant to run on windows 64 bit and Linux 64 bit. Can we direct the com

How can I use ranges max to find the closest point to another given point?

So I've created a structure called point that will consist of two integers. Then, created a function called closest() that's going to take an std::vector co

Deleting a pointer to a pointer causes "Invalid address specified to RtlValidateHeap" error

I was solving a simple math question which needs to add solutions continuouslly to the answer set. So I designed a class with a pointer to a pointer in it. When

Bounds of mesh are scaled by its world postion

I am trying to get the correct world postion and size of the bounds for a mesh, however the size of the bounds are scaled by the position of the mesh. The bound

Make can't find boost header in docker container

I'm trying to build a simple client server connection in docker with boost sockets. When I compile the files on ubuntu without docker it works. But when I try r

getting "Permission denied" while reading from file using custom C++ build in sublime text 4

I use sublime text 4 on macOS. I have a custom C++ build to read from a input.txt file in current file path. but when I run my custom build, it shows bash: /Us

normalize image with opencv in c++?

I have a TfLite model that takes a standardized float32 image as an input, the pixel range should convert from the [0~255] to [-1~1] I wrote a demo function but

How do we call c++ application from web on client side on linux

For example, a client has a c++ application, and trying to access web application on the browser. But the web application needs to run this application. I don't

How do we call c++ application from web on client side on linux

For example, a client has a c++ application, and trying to access web application on the browser. But the web application needs to run this application. I don't