Category "c++"

How to get the number of rows and columns of an Eigen::MatrixXd?

I am trying to traverse Eigen::MatrixXd matrix. However, there does not seem to be a function that returns the columns size nor the row size. Does anybody have

How to use the OpenCV c++ with VSCODE

Base on this video https://www.youtube.com/watch?v=l4372qtZ4dc I am trying to use OpenCV in vscode but I canot include the, .lib files what should I do main.

How to remove "noise" from GCC/clang assembly output?

I want to inspect the assembly output of applying boost::variant in my code in order to see which intermediate calls are optimized away. When I compile the fol

WebView2 proxy C++

I found this thread on GitHub, but seems that the code is not C++: WebView2 _webView2 = new WebView2(); CoreWebView2EnvironmentOptions options = new CoreWebVie

get mtu C++ portable way

Is there a way to get mtu C++ portable way? Like from both Linux and Windows ? I know in Linux this is the code : sys_get_mtu(const char *ifname) { struct

how to access only element of unordered_set in c++?

For ex, unordered_set<int> s ; s.insert(100); How do I get value 100 from s? From http://www.cplusplus.com/reference/unordered_set/unordered_set/begin

How to take input 128 bit unsigned integer in c++

I am new to c++. I want to take input a unsigned 128 bit integer using scanf and print it using printf. As I am new to c++ , I only know these two methods for i

Error message "Undefined reference for std:string" [duplicate]

I have some code that reads the name of the file from arguments and outputs that file into the command line: #include <stdlib.h> #includ

Joining two characters in c++

My requirement is to join two characters. For example int main() { char c1 ='0'; char c2 ='4'; char c3 = c1+c2; cout<< c3;

Including <termios.h> and <asm/termios.h> in the same project

What I want to achieve: I want to set custom baud rate values for some tty*-like UART-mapped terminals. How: The only way I found by far is to use the struct t

Integrating x86 assembly in C++ project for old MS-DOS system information program

I'm new to C++ programming and have always wanted to write a system information program for MS-DOS. I'm currently using the latest DigiMars C++ compiler and MA

Getline & cin.ignore in c++

I know there are similar questions to mine, but I checked alot of them and didn't find the answer so I hope someone can help me. So what I am trying to do is st

Windows SetTimer() vs using SleepConditionVariableCS()

I currently have a timer implemented using tbb::condition_variable which under the covers uses native Windows call SleepConditionVariableCS() . One of my co-wor

What could be the source of this aliasing?

I am manually raytracing a 3D image. I have noticed that, the farther from the 3D image I am, the bigger the aliasing. This 3D image is basically a voxelized r

Compress string with GZip using qCompress?

I have a string of hex data (0a000a0165787a... etc) that I write to a file like this: void Output(QString FilePath, QString Output) { QFile file(FilePath);

Convert an int array to a single int

I'm trying to convert array[]={1,2,3} into a int number=123; how can I do that ? my code is this: int main() { int array[]={1,2,3}; int number;

Vulkan: Errors when adding 3rd descriptor

I have a Vulkan program that has descriptors for a Uniform buffer and a Combined image sampler. I tried to add a 3rd descriptor to for a Dynamic Uniform buffer

VSCode "go to definition" not working

I installed Visual Studio Code 1.1 with the C/C++ extension, opened my C++ project and tried to use "Go to definition" in vain. The "Go to definition" is not w

What is the purpose of std::function, and how to use it?

It is necessary to me to use std::function but I don't know what the following syntax means. std::function<void()> f_name = []() { FNAME(); }; What is

Calling javascript function in c++ with emscripten embind

This question comes in two parts. What I want to do is to put most of my program logic in c++ classes and some view related function in js (like DOM manipulatio