Category "c++"

What is wrong with Insertion Sort on Doubly Linked list?

I am getting some random result. I have gone through the flow and did dry run several time but can't figure out exactly what's wrong with the code. flow of prog

How to access private members in friend function in header class

I have created header file for definition of Class Name.h class Name { private: char* Fname; char* Lname; public: Name(char* ='\0', char* ='\0'

Overloading the assignment operator= doesn't work for anything except the implicit object passed in c++

The comparison in the assignment operator works as expected, but when I try to use a temp variable and load then return that, all it returns is the defaults. De

Can C#(.NET 6) call managed/unmanaged C++ dll?

I'm attempting to call a c++ DLL(WinSDK: 10.0.18362.0, Platform Toolset: VS 2017 v141) from C#(the target framework is .NET 6.0) on ARM, and I compiled them for

Why is conversion from string constant to 'char*' valid in C but invalid in C++

The C++11 Standard (ISO/IEC 14882:2011) says in § C.1.1: char* p = "abc"; // valid in C, invalid in C++ For the C++ it's OK as a pointer to a String Lit

When I build and run code on CodeBlocks why do I now get a zsh: file or directory not found error?

I have written some code in CodeBlocks, and when I run it, I get a zsh: file or directory not found error. I never used to get this before but after installing

Spiral Iteration

I need an Algorithm that I will use to scan pixels out from the center. Problem is with different lengths and sizes, it sometimes can't get to the position (See

How can I get my counter to work properly?

I'm doing my c++ homework on arrays, everything seems to be working fine except the counter for the problem. Before I show the code these are the requirements f

conan + cmake generators : include directories not found during compilation

I am new to Conan, and I'm struggling to use specific conan packages in CMake. I started with including boost to my project using conan, and that worked out gre

Comparing latency of mutex vs. spinlock wake time

I am curious about the latency of a mutex vs. spinlock, measured as the time between when one thread unlocks it and another waiting thread can access it. I wrot

C++ : Using for loop to declare pointer, shows segmentation fault

I am learning C++ pointer on array recently, what I'm trying to do is to use the for loop to declare batch of pointer and cout the address and value, My code is

Importing a C# .NET 6.0 Core Dll into a C++ without TLB file

I have quite a number of C# Dlls that were made in .NET 4.6 Framework and need to get upgraded to .NET Core 6 - that part is relatively straightforward. However

Determine the object type of a HDF5 path

I have a path name (a string) and an open HDF5 file. I have used H5Lexists to ensure an object with that name exists. How do I determine what the object type is

How to construct a class from a pack in C++?

I am trying to initialize a class with a pack passed as an argument to my function. Here is what I got so far: struct Vec3 { float x, y, z; }; template<

How to add the UIA ExpandCollapse pattern in Qml

I'm using http://accessibilityinsights.io/ to make sure my QML application passes Microsoft requirements for accessibility. There's only one error that I couldn

Global Locale Warning using C++ and gtkmm

I'm working on a gui using gtkmm and everything is working, but I get a warning that I can't figure out: ** (process:28120): WARNING **: 13:08:38.752: Can't set

AdjustWindowRectEx returns different results in VS and C++Builder

I try to use AdjustWindowRectEx() function to get the sizes of the window frame with aero theme enabled. But I found that AdjustWindowRectEx() function returns

Curl using Nuget on Visual Studio 2022 doesn't work

I've been trying to get Curl to work with VS for weeks. I've read a ton of other tutorials, guides, installation instructions and other materials and just... No

What is difference between adding a character and pushing a character in a string?

I was doing a question where I was adding a character using for loop in string like this: for(int i=0;i<n;i++){ str = ch + str; } This code was running

Im having trouble with this assignment that has me write vectors and arrays to a file

So in this assignment I have to have one function that has the user enter the vector which is the driver name and then they enter the drivers 4 points. That fun