Category "c++"

Using User Set Variables to Create an Instance of a Class

I was wondering if anyone had any advice on how to take a user input from a std::cin and enter it into a variable. The variable would be used to add an object t

Ultra fast lookup in small sized container of 64-bit integer values using dynamic perfect hashing

I have input keys that can cheaply be converted to a uint64_t (ie, the input contains less than or equal to 64 bits). Each unique key (not yet in the map) will

Adding code to my AppDelegate / AppController

I'm trying to add code to my AppDelegate. But I am not sure where to do it - and how exactly. I am trying to achieve Deep Linking, so I am trying to add my code

How to use Visual Studio and CMAKE and GTEST to generate code coverage report

I'm trying to generate a code coverage report using visual studio 2022, using cmake + gtest, but my vs2022 always doesn't work. I've rummaged through google and

QLineEdit: how to put cursor at the end of typed text?

There is a QLineEdit in which you need to enter a phone number. Gave him a mask ui->lineEdit_4->setInputMask("+7\\(999\\)999\\-99\\-99;_"); Further, when

C++/Omnet++ connect to SUMO via TraCI Interface

I have a question regarding connecting to SUMO as a second client. I have found the following tutorial from Sep. 2021: https://www.academia.edu/49581640/Manual_

glm::ortho doesnt display anything

I need an orthographic projection matrix in OpenGL and I use glm for it like this: glm::ortho(0.0f, width, 0.0f, height, zNear, zFar); But this does not produc

sequential_vertex_coloring with ordering in Boost graph library C++

I'm a novice with the boost graph library. I'm trying to use the sequential_vertex_coloring algorithm (https://live.boost.org/doc/libs/1_79_0/libs/graph/doc/seq

Can I know why I only get one puzzle not the figure I wanted?

I attached an image which is a row of different colours puzzles and the code runs perfectly fine except for the figures that supposed to be shown ... the figure

How to call a MFC Regular DLL in Dart or Flutter?

How could I call a MFC Regular DLL in Dart/Flutter? I successfully called a pure (No MFC) C++ DLL. But when I pasted the same code into a new-created MFC regula

Function template in header: implicit instantiation duplicated or shared?

Following function template is defined in Foo.h. #include <array> using namespace std; template<unsigned N> array<int, N> gen_arr() { array

Merging two sorted array on third by creating a new array on heap

I have a class array inside which I have declared an array its size and length. I am trying to merge two sorted arrays by creating the third array on the heap a

Is there a way to get win32 file handle from pipe's C file descriptor (python)?

Searched for about 1 hour and still unable to find any relevant search results. I want to wait on multiple pipes in a single thread, but unable to convert the f

How to make an overload for templated functions for a custom container's iterator

This is a generic question about templating, I am using advance as an example. Assume there are reasons I can't use ADL or hidden friends here. The definition o

How can I change map 's second component?

#include <iostream> #include <map> using namespace std; int main() { map<int, int> ma; // 원소를 추,

value of set::find() if not found in container

I am trying to understand std::find(). Below is my code. std::set::find searches the container for an element equivalent to val and returns an iterator to it i

Too many copies of the function to use std::move in C++

I have 2 classes: A and B. I need to pass instances of them to a function that will push them into a vector. I want to have good efficiency in my program, so I

why dont we need to refer to class name when referring to methods in c++

Coming from a good foundation in java to c++, I'm really confused on why when we use the cmath library we don't have to call it like: classname.function like we

What is an undefined reference/unresolved external symbol error and how do I fix it?

What are undefined reference/unresolved external symbol errors? What are common causes and how to fix/prevent them?

SSE1,2,3 round() not fully follow std::round() result

I'm trying to make similar to std::round() function using SSE(1,2,3) instructions but have some issues with certain values and/or logical operators. Here's my c