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(
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
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
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
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
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
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
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
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
I have a strange problem with gcc and constants and .rodata Let's assume: typedef const struct { const char *a; } data_t; typedef const struct { const dat
TL;DR: GCC 11.2.0 (image f7ea55625e09) + C++20 + <vector>'s std::vector<anything> cause useless output. How to get out something I can work with? Co
I'm trying to implement rendering with different cameras. When I use only one camera, everything is ok. But when I have two cameras with different transformatio
Before the assignment operation, the member variable u works fine, see figure 1 After the assignment operation, the data of the member variable u is tampered, s
I'm developing a high load server application using C++ and libpq (libpqxx is very unstable). I use async queries in threads to improve performance. But I've di
I'm trying to install Quantum ESPRESSO on my computer and have run into an issue when using the ./configure command in the unpacked directory. $ ./configure ch
I have created a particle effect and I am attaching it using UGameplayStatics::SpawnEmitterAttached(Elecricity, gunMesh, TEXT("MuzzleFlashSocket")); but the par
I am studying AVX by writing AVX code with inline assembly. In this case, I tried to implement AVX in a simple function. The function name I made is lower_all_c
I am using vkEnumerateInstanceVersion to get the vulkan api version and pass it to VkApplicationInfo struct. I can easily differentiate between VK_VERSION_1_0 a
#include <stdio.h> #include <iostream> #include <string> #include <chrono> #include <memory> #include <cstdlib> #include <
All students are surprised by the behavior of C++ using-directives. Consider this snippet (Godbolt): namespace NA { int foo(Zoo::Lion); } namespace NB {