Category "c++"

How do I invoke a C++ Arduino library from rust?

It has been possible to build apps for Arduino and Teensy written in Rust for a while. You can find lists of peripheral libraries ( https://github.com/rust-embe

protocol buffers - store an double array, 1D, 2D and 3D

How can be an array of double (1D) stored using protocol buffer? What about multi-dimensional (2D or 3D) dense arrays?

What is the size of a pointer?

Is the size of a pointer the same as the size as the type it's pointing to, or do pointers always have a fixed size? For example... int x = 10; int * xPtr = &a

How to correctly set rpath to shared library with CMake?

How can I link OpenNI (libOpenNI2.so) at run time to my C++ program? This question/answer is most relevant to my question. I followed it and prepared the follow

Clangd in VSCode: .clang-format and .clang-tidy files

I've been trying to setup my VSCode to work with Clangd as a LSP server for my Cpp projects. I've successfully established basic functions such as the LSP itsel

In node-gyp binding.gyp file, how to include different library files based on the system arch (32 bit, 64bit))

I am currently trying to connect c++ with nodejs project using node-gyp. My current problem is that i have a 32 bit library file and a 64 bit library file. My c

How can I print value of std::atomic<unsigned int>?

I am using std::atomic<unsigned int> in my program. How can I print its value using printf? It doesn't work if I just use %u. I know I can use std::cout,

Anaconda ImportError: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found

I am getting the following import error when I am trying to run a Python script in a conda environment (squad) azada@scholar-fe00:~/Desktop/Toy-Problem-Team-2 $

Efficiently maintain slightly different (logging/non-logging) functions

I have a number of algorithms for community detection on graphs that I want to now visualise them. This visualisation requires me to 'hijack' these algorithms

What is the no-undefined-behavior way of deserializing an object from a byte array in C++11 (or later)?

To overcome alignment issues, I need to memcpy into a temporary. What type should that temporary be? gcc complains that the following reinterpret_cast will br

Problem with EOF when determining stream end

When I try to determine end of file with function feof(FILE *), I find it does not work as I expected: an extra read is required even if the stream does end. E.

Qt 5.1.1: Application failed to start because platform plugin "windows" is missing

Edit: Some people started to mark my question as a duplicate. Do not forget that many similar questions existed when I asked this one (see e.g. the list below).

std::regex escape special characters for use in regex

I'm string to create a std::regex(__FILE__) as part of a unit test which checks some exception output that prints the file name. On Windows it fails with:

Finding the 1500000th Fib Number Using C++

I wrote the following code to find the 1500000th Fibonacci number(Please ignore horrible indenting, I wrote this in about 2 minutes). I need it as a string. Thi

How to check that SDP service record was registered correctly in C++/Linux

I am trying to register my bluetooth SDP service in C++ linux as shown here: Example 4-9. Describing a service Where or how can I check exactly that the servic

How to order strings case-insensitively (not lexicographically)?

I'm attempting to order a list input from a file alphabetically (not lexicographically). So, if the list were: C d A b I need it to become: A b C d Not the

Get std::set comparison as function parameter / complemet of a set without universal set

I have this .cpp file and I have to write the methods set_union, subset, complement, and contains. My two problem is first: How can I have a complement without

Convert json value to int in c++

I'm reading a json value in c++ using Json::Reader reader and the value is stored in Json::Value root This root contains "age" and "id" and I want to conve

POST form data using WinInet c++

I'm trying to make this program connect to a website and submit form data in order to login, but I don't know what I'm doing wrong. I have heard of others like

Unable to link libclang with cmake on VS2017

A while ago I wrote a code generation program to use in my 3D game engine. I added a target to my cmake files, linked libclang with it as I'm using that for par