Category "c++"

cygwin_exception::open_stackdumpfile google test

I have read a few topics about errors: cygwin_exception::open_stackdumpfile: Dumping stack trace to program.exe.stackdump But I can't find something that fits m

Receiving error: "error: static assertion failed: result type must be constructible from value type of input range" when constructing class vectors

I am trying to create a script that uses polymorphism to create a set of linking vectors within parent/child class structure. So far I have got the classes setu

how to initialize a class object reference in C++ to simulate NRVO?

I meet a course programming problem, which asks me to initialize the A a using passing by reference (initialize the A a in the func). How can I call A's constru

How to detect if function is implemented in installed library?

I have my program for windows, which uses windows system library (let's name it "sysLib"), and it implements function "libFun1". My program can look like this:

C++: How to remove elements from array at given range without a vector?

I want to delete elements from an array for the given range (indexes) without using vector. For example, if the array is arr[5] = {1, 2, 3, 4, 5} and the lowRa

What is the difference between local and global variable in C++?

I'm trying to make some simple OpenGL application with light included. I want to have a position of my light in the global scope to change it in some other part

How do i write nested if statement? [closed]

So i want to make a simple if statement like this : if(a=1) { if(variable1=1) { cout<<"a1=1"; } else {

can I build a production level windows application in Python

I'm trying to build a Windows Application in Python. But, sometimes I question myself, can this Application run on another person's PC without installing Python

std::stringstream's seekg does not work after while loop

I have this std::stringstream object whose contents I have to read (only) twice. For this I thought I could use its seekg member function to repeat the reading.

extern "C" DLL: Debug is OK, Release throws Error C2059

I've got a DLL that I've created as a C++ Win32 application. To prevent name mangling in my DLL, I have used the EXPORT definition defined below: #ifndef EXPOR

Is there any way to control optimization of a template function in visual studio c++ 2017

I tried using #pragma optimize("", off) to selectively disable optimizations for the a() function. This does not work. Is there any way to control optimization

Time limit exceeded in GeeksForGeeks zig zig traversal in tree

I am working on the GeeksForGeeks ZigZag Tree Traversal problem: Given a Binary Tree. Find the Zig-Zag Level Order Traversal of the Binary Tree. Example 1: Inp

C2059 syntax error: ',' after upgrading to Python 3.9 from Python 2.7

I have a C++ application that runs on Python 2.7, today I decided to upgrade to Python 3.9 but ever since then I've been getting the following error in visual s

Getting Segmentation Fault error in C++ code

#include<bits/stdc++.h> using namespace std; //FIRST REPEATING ELEMENT (APPROACH 2) int main() { cout<<"running"; int n; cin>>n;

Move elements while reallocation elements in vector

I have the following code: #include <vector> #include <iostream> struct Data { Data() = default; Data(const Data& other) {

Issue overloading the operator c++

I keep getting the following errors Error (active) E0349 no operator "<<" matches these operands Error C2678 binary '<<': no operator found w

Is it possible to calculate the value after overflow?

I understand that if 1 is added to INT_MAX it will overflow and we will get the negative maximum. It is connected in a cycle. In the code below can I calculate

Api server rest with crow

I am implementing a server rest using Crow. In my code i want to do some action before sending the response. These action are complimented in another class. it

Passing enum to argument of integral type

Consider the following code: enum ABC : char { a, b, c }; void ff(char c) { cout << "char\n"; } void ff(int i) { cout << "int\n"; } i

What is the best way to solve multiple definitions introduced by a 3rd party library? [ELF and Mach-O]

Background Imagine the situation: static library libR.a is written rust and it depends on libCXX0.a. Binary X depends on both libR.a and libCXX0.a and it is wri