Category "c++"

uint16_t array to string and back c++

I have a uint16_t array and I want to be able to convert it to a string and convert it back. The goal is to save the array with this library and load it back in

Why Input/Output Error occurs when use ls command in my fuse filesystem?

Why I/O Error causes when I tried ls . command in my fuse filesystem? My filesystem has a limitation that it only allows mail address type as individual filenam

Why do std::stof, std::stod, and std::stold handle errors with exceptions?

What is the rationale for why std::stof, std::stod, and std::stold throw exceptions? http://en.cppreference.com/w/cpp/string/basic_string/stof Input errors are

How to generate .pdb file in Visual Studio 2019 for C++ from command line

I am using cl.exe C++ compiler in Visual Studio 2019 from the command line. But, I am unable to set the required flag to produce a .pdb file to debug in a separ

GL Error 1280 when enabling depth test

I'm having some problems with an opengl application I'm writing. GLenum err = 0; glEnable( GL_DEPTH_TEST ); err = glGetError(); if ( err != GL_NO_ERROR ) p

clang: What does emitting mean?

The clang diagnostics reference uses the word emit three times. The following warnings use this term. Example 1: Compile this with -Wunneeded-internal-declarati

Valgrind shows question marks

I have compiled a program using Code::Blocks. I have turned on "produce debugging symbols" under the "Debug" target, and also turned off "strip all symbols..."

Warning: function 'F' is not needed and will not be emitted

Here is a little program (live on godbolt): static void UnusedDeclaration(); static void UnusedDefinition() {} static void Declaration(); decltype(Declaration(

print fibo big numbers in c++ or c language

I write this code for show fibonacci series using recursion.But It not show correctly for n>43 (ex: for n=100 show:-980107325). #include<stdio.h> #in

Can i track my mouse pos outside a SDL window?

I build a clock with SDL, its a window without border. Now i still wanna be able to move my clock around my screen so i wrote a function to move it. Basicly it

Fail to insert the element of the set to the vector in c++

Given a set of integers: set<int> setA = {1,2,3,4,5}; Now I want to insert the integer to a vector of integers under a certain condition: vector<int&g

Operator Overloading Test Failure

Build is successful, but the test case #2 keep failing. I don't know what to change or fix. The test program says that Test Case #2 operator <=() FAILED and

overload array operator for mystring class

I need help figuring out how to overload the array operator for a MyString class that I have to create. I already have everything else figured out, but the arra

Microsoft bond c++ runtime deserialization using runtime schema

I could not find anything useful in their docs or examples :( They have docs of how to deserialize schema, and then how to traverse it - that works great. They

How can I include a C header that uses a C++ keyword as an identifier in C++?

I've been using C++ and compiling with clang++. I would like to include the <xcb/xkb.h> header for an X11 program I am writing. Unfortunately this header

HDF5: How to read an array from a dataset

I have never seen this before, but I have a file with a 1x1 dataset where the only value is a Array[3] of 64-bit floating point. I can see this using the HDFVie

Using std::string for key with AES encryption in Crypto++

I am using Example of AES using Crypto++. I want to encrypt with this key: std::string key = "mykey"; Allocate memory for key byte key[ CryptoPP::AES::DEFAU

Saving a Child class instance in a parent type variable and using the Child's functions through parent variable?

I have two classes called Bird and Eagle. The Eagle is inherits from the bird. Now, I can use the Bird Class to store an eagle type instance. However, when i tr

How to set up Raspberry Pi 4B as a I2C slave

I'm trying to set up a RPi 4B to work as an I2C slave with PSoC (4.4) - CY8C5888LTI-LP097. Below is my code to set up the slave address on the Pi. import pigpio

Serial port becomes unresponsive on Ubuntu 20.04, but works on Ubuntu 18.04

I wrote a C++ program to continuously read data from a device, via serial over USB. The program works flawlessly in Ubuntu 18.04 (Bionic Beaver). I have an