Category "c++"

Datetime parse and format in C++

I'm using time_point the first time. I want to parse datetime from string and found a difference when returning back to string from 1 hour. std::chrono::system_

How do I avoid printing the first node in my linked list?

I'm trying to create a linked list that has 2 data types and a function that inserts nodes. But in order to insert nodes, I have to create at least 1 empty node

strange error in main and incorrect reading of a vector [closed]

hi I was writing a code where near the vectors it returns true if they are placed in ascending order otherwise false, when I try to start the

DocuSign JSON SOAP Request

I am trying to understand how to send SOAP requests with JSON formatted data to docusign. Following this guide is only for pdfs: https://developers.docusign.com

I made my own strcpy function, but it is not working. How to fix it?

I attempted to make my own mystrcpy() function, which takes the same arguments as the standard function. It is not responding. The array does not get copied. si

Is a constructor a function and is it possible to call a constructor

I came across this where one of the user comment says: A constructor cannot be called, it is not a function. It is invoked automatically when a new object is c

How to convert YOLOv5 PyTorch model to OpenCV DNN compatible format

Could anybody please help me to convert YOLOv5 PyTorch model to ONNX or TensorFlow format to be able to use it with OpenCV C++ inference? I used this tutorial t

Compilation Failing for xalan-c in Ubuntu

I am trying to build xalan-c (version 1.12) with icu in Ubuntu but it fails. Could anyone help me with this. Environment : Ubuntu 20.04 Steps to reproduce : Cl

I just can't get it. What is wrong in this?

Please see the error and help me. Its showing error. I just can't understand where is the problem?? I have resolved all the errors that could be solved but stil

Double stack linked list segmentation fault

So I've been asked to make a C++ program Double stack with linked list. I can't find any tutorial or example on Google, most of them use Array to do it. so I ha

Initialize array based on C++ version and compiler

In C++11 or higher regardless of compiler int myArray[10] = { 0 }; would initialize to all elements to zero. The question is would this also work in C++98 and c

Auto-filling the HTML input field with a C++ QString value

I am finding the 'Sign in' text on the QWebEnginePage and then auto filling in the emailId in the input field if the correct page is displayed. The value of ema

Optional node still visited in OR-tools vehicle routing problem

In a simple vehicle routing problem solved by Google OR-tools library, two nodes (2, 3) are marked as optional with visiting penalty set to 0. The shortest path

Set working directory for visual studio code for C++ project

I have a C++ project in Visual Studio Code and I am trying to set the working directory so I can do "Assets/model.obj" to access a model instead of having to pa

Reading a vector of maps with yaml-cpp fails

I want to read the following yaml data: camera: response_values: [[0.0: 0.0, 1.0: 1.1, 245.0: 250.1], [0.0: 0.1, 1.0: 1.3, 200.0: 250], [0.0: 0.0, 1.0: 1.1, 24

CMake Error at CMakeLists.txt:7: Parse error. Function missing ending ")". End of file reached

cmake_minimum_required(VERSION 3.0.0) project(opencvtest VERSION 0.1.0) include(CTest) enable_testing() set(OpenCV_DIR C:\Users\Sayar\opencv\build\) find_pac

Calculate length of string object using pointers instead of char arrays

I'm working on an exercise to calculate the length of a string using pointers. Here's the code I've written below: int main() { std::string text = "Hello W

what is the use of keyword override in virtual function of child class? [duplicate]

The keyword virtual allows the derived class to override in need of polymorphism, and this can be down with or without the keyword override. H

Clarification about modern CMake structure

I am not an expert C or C++ programmer, but I have to write a C and a C++ application for two course projects. To start off on the right foot, I was reading a g

Can a constructor affect other fields of an enclosing object, or is this a static analysis false positive?

Consider this C++ code: struct SomeStruct { SomeStruct() noexcept; }; //SomeStruct::SomeStruct() noexcept {} class SomeClass { const bool b; const SomeS