Category "c++"

cppcheck How to suppress inline unmatched suppression?

I found that --suppress=unmatchedSuppression only suppresses unmatched suppression types in cppcheck options, but NOT unmatched inline suppressions. Is this t

worth the time investment to learn Qt (c++)? [closed]

i already know java, c++ (no one framework for GUI development) and little of c# (winforms for gui development) but i'm thinking to ivest my f

Why does QStringLiteral returns a garbled string

I'm programming a Chinese software, and embed some of the strings in the source file. To reduce runtime overhead (well, actually this is premature optimization,

C++ object hierarchy - how to manage circular dependencies?

I want to make two classes: an object and an object_manager, but I'm confused about how they should see/include each other. I've heard that it's forbidden for t

ROS2: how to create an Int8MultiArray

This is a ROS2 beginner question I've tried to use several ROS sources which suggested me to include "std_msgs/Int8MultiArray.h". However, if I do that I will g

Is there a functional difference between "2.00" and "2.00f"?

I ask because I am using the Box2D library, which calls for mostly float arguments. Although I see a lot of example code that uses the 0.00f format, I am not qu

What is a constant reference? (not a reference to a constant)

Why do constant references not behave the same way as constant pointers, so that I can actually change the object they are pointing to? They really seem like an

Restricting header inclusions in C++

What is the best way to restrict use of certain headers(features of the library itself) in certain Cpp files. And if it fails to follow the set rules, compilati

How is a Vector of Vector aligned in memory?

I understand as Set size of vector of vectors at run time describes, one can declare vector of vector as vector<vector<int> > ref; then resize t

isPalindrome homework exercise

Write a program that uses the function isPalindrome given in Example 6-6 (Palindrome). Test your program on the following strings: madam, abba, 22, 67876, 4

Should virtual dispatch happen when a virtual method is called within a virtual method using object?

struct B { virtual void bar () {} virtual void foo () { bar(); } }; struct D : B { virtual void bar () {} virtual void foo () {} }; Now we call foo()

C++ What is the difference between definition and instantiation?

What is the difference between definition and instantiation? Sub-question: Are "variable definition" and "variable instantiation" the same? int x; The above

String plus Char - what is happening?

I'm just curious about what is going on when trying to add a char to a string. Initially, I thought it would work like a concatenation but it didn't: cout<&l

Serializing a class which contains a std::string

I'm not a c++ expert but I've serialized things a couple of times in the past. Unfortunately this time I'm trying to serialize a class which contains an std::st

How to compile a c++ program in Linux?

I made a file hi.cpp and I wrote the command given below: #include <iostream> using namespace std; int main () { cout << "Hello World! "; cout

Creating conan test_package recipe

I'm currently playing around with conan. So I've created two small project: The first project is a small library "fcdk": https://github.com/lmarzull/fcdk/tree/d

c++11/regex - search for exact string, escape [duplicate]

Say you have a string which is provided by the user. It can contain any kind of character. Examples are: std::string s1{"hello world"); std::

comparator for sorting a vector contatining pointers to objects of custom class

By this question I am also trying to understand fundamentals of C++, as I am very new to C++. There are many good answers to problem of sorting a vector/list of

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?