Category "c++"

GCC -Wimplicit-fallthrough is not warning when I miss [[fallthrough]]

I am using GCC version 8.3 and have a switch statement: #include <iostream> enum class Type : char { Value1 = 'A', Value2, Value3, Value4

How do I start my project in Unreal Engine 5?

I've tried to create my new Unreal Engine 5 project from a tutorial with c++ and when I try it comes up with this: Running C:/Program Files/Epic Games/UE_5.0EA/

Remote Desktop - getting session information (id, session name, etc.) from client side

Let's consider the following scenario: take a Windows Server instance (2012 or newer), with multiple user accounts. Each of those accounts needs to run an indiv

Configuring compilers on Mac M1 (Big Sur, Monterey) for Rcpp and other tools

I'm trying to use packages that require Rcpp in R on my M1 Mac, which I was never able to get up and running after purchasing this computer. I updated it to Mon

How to manually disable libstdc++ in CMake for Clang

Recently I'm configuring a new project in language C and C++ using both CMake and llvm Clang with Visual Studio Code for a program where EVERY exact object or l

What to use on Nodejs addons. Node.h or Napi.h

I have some pretty simple questions. What is the main difference between node.h and napi.h. What should I use for normal/personal use case. Why are there more "

Inserting non-const pair into `std::unordered_map` is slower than const pair

I have some code like these (from cppcon), when inserting a non-const pair into a unordered_map, the performance is very different to inserting with a const one

QProcess does not work if the path in argument list has a whitespace

I want to execute following command using QProcess, that works in cmd already if executed: C:\\myApplication\\tools\\dcmodify.exe -v -ie -gin -nb -ma (0010,0010

c++20 coroutines: boost asio co_spawn blocks from another coroutine

I do not know if this is the expected behavior of boost::asio::co_spawn (I did check the docs 1.78.0...), but if i call (e.g. co_spawn(ctx, ..., detached)) from

Performance problems with the C++20 spaceship operator?

Since C++20 the standard library uses the spaceship operator to implement comparison for strings and vectors (according to this video). I am worried that this c

bad_alloc when attempting to print string that was assigned to member of $$ struct

During our compiler's intermediate code generation phase, and more specifically while testing the arithmetic expressions and assignment rules, I noticed that al

Why does string not work here while char const* does?

Why does string not work here when I catch an error, and char const* does? What is the difference between the two? try { throw "connection fail"; } catch(

Holder class (Having some objects references) compile error: 'Can not be referenced -- it is a deletted funciton'

I need a "holder" class. It is supposed to store objects references. Like: holder.A = a; // Gets a reference! Sample code bellow including the compiler error: c

Reading arguments from a text file using <

I have a txt file called test.txt that looks like this, hi this is a test and I have a c++ file called selection_sort.cpp that looks like this, #include <io

Weird bug in pointers

I was trying to access single bytes of an int value via the code below. My problem is that whenever I try to remove long int i=0; from the code, it gives me a s

Couldn't create a linked list

My create function is not creating a linked list. I can't seem to figure out the problem here. The code runs but I don't get any output. Can anyone figure out w

What is the time complexity of passing a Vector of size n to another function by passing by value and passing by reference?

void fun(vector<int>vec) { some code } int main() { int n = 5; vector<int>avec(n); fun(avec); } What is the time complexity of passing

windows - how to link against API sets (*ms-win*) instead kernel32.dll, ntdll.dll etc.?

How do I specify explicitly to MSVC compiler / linker to link against API sets (*ms-win* pattern matcing dlls) instead kernel32.dll, ntdll.dll etc.? For example

How to subtract char out from string in c++?

Hello I want to know how to subract string from string For example If string s = "124ab" I can easily extract integer by using sstream but I don't know how to e

ByBit Api. Open Active Order. Return "empty param of timestamp". Libcurl c++

Please help!!!! Is there a working example of opening an order in C++ Constantly sending a request to open an order POST https://api.bybit.com/private/linear/or