Category "c++"

Convert between std::u8string and std::string

C++20 added char8_t and std::u8string for UTF-8. However, there is no UTF-8 version of std::cout and OS APIs mostly expect char and execution character set. So

Qt C++ : Cannot instantiate class derived from QAbstractListModel

Using Qt wizzard I created ToDoListModel2 class derived from QAbstractListModel. Code: todolistmodel2.h #ifndef TODOLISTMODEL2_H #define TODOLISTMODEL2_H #incl

Is it possible to make mods in C++ for the bedrock edition on a Windows 10 PC?

(thread title) bedrock minecraft more recognizable as "Windows 10 Edition" Minecraft, is it possible to create a sub category UI menu similar to that in Java mi

JNI: SIGSEGV when calling native function from Java, after native registration of same function on library second opening

I have an Android app that is structured in the following way: CORE: Is the class of the accessibility service that dinamically loads a few dex files. It will b

C++ in vscode: error: no matching constructor for initialization of 'std::thread'

I just started to use vscode and I did a tutorial about multithreading in c++. The code below is just the same as the tutorial and I'm sure the code works in vi

"No tests were found!!! " in cmake tutorial step 4

The contens of CMakeLists.txt: cmake_minimum_required(VERSION 3.10) # set the project name and version project(Tutorial VERSION 1.0) # specify the C++ standar

C++ friend template function: Function definition not found

While trying to wrap my head around C++ templates I have run into a compiler warning I do not understand. In below vec.h Visual Studio 2019 will put a green squ

I have to put an alphanumeric password in a text file

Here's the code: #include <iostream> #include <fstream> #include <string> #include <cstdlib> #include <ctime> #include <windows

How to use a Third-Party DLL in Visual Studio Code

I have a couple of header files that call functions from DLL files, and I was wondering how I could provide the link for the header files and DLL files to commu

IMG_Load() with jpg returns "unsupported image format"

I'm trying to load images using SDL2-image, it works when I try to load a .png, but it fails to recognize a .jpg My imports: #include <SDL2/SDL.h> #undef

What should I change in this code to display the point of every node on the route?

This is a C++ code for A star and this code every time when I run it, it will display route randomly. I want instead of the numbers are shown below in the pictu

Trying to implement shadow using OpenGL; depth texture seems correct but shadow is not displaying

trying to implement shadow. I checked my depth texture on a quad, and it seems correct, but the shadow is not displaying. I check my shadow vertex and fragment

C++ While loop not re-assigning string value

I had created a program that counts the amount of vowels in a provided string. It counts the vowels correctly and repeats when the user provides a 'y' or 'Y'. H

Can I define a macro in a header file?

I have a macro definition in MyClass.h, stated as such: #define _BufferSize_ 64 I placed the include directive for MyClass.h inside of main.cpp: #include "M

C++ While loop not re-assigning string value

I had created a program that counts the amount of vowels in a provided string. It counts the vowels correctly and repeats when the user provides a 'y' or 'Y'. H

Why can't I use ament_cpplint with cpplint plugins for various IDEs?

I am working with C++ code with ROS2. ROS2 has code style standards and one of the recommended linters is ament_cpplint, which is slightly different from cpplin

How can I make a function creating tens of thousands of symbolic filesystem links show up in VTUNE?

I'm profiling some binary on CENTOS 7.6 using VTUNE. I've yet to find the function (in vtune output) which is creating tens of thousands of symbolic file system

How to detect non IEEE-754 float, and how to use them?

I'm writing classes for basic types, so that code is logically the same on multiple platforms and compilers (like int_least16_t for int). For fun! (I'm still a

How to generate a symmetric key in C or C++ the same way this script does?

I am implementing Azure DPS (device provisioning service) for my ESP32-based firmware. The bash script I use so far is as follows (where KEY is the primary key

12 hour to 24 hour time conversion

I am trying to write this c++ program from hackerrank but in my output all I am getting is a blank space. The input string is in the form of HH:MM:SSpp where