Category "c++"

How to constrain class template by disabling type argument of specialization itself, and why does(n't) it work?

Is it currently possible to constrain a class template that rejects type argument which is the specialization of the class template itself without using static_

Finding the non zero digit after mutiplying each element in array

Input: N = 4 arr = {3, 23, 30, 45} Output: 5 Explanation: Product of these numbers is 93150. Rightmost non-zero digit is 5. can u solve this question in c++ and

OpenMP can't parallelize for loop with map iterator

The code is as follows. int main() { map<int,int> a; for (int i = 0; i < 6; i++) { a.insert(make_pair(i, i+1)); } map&

Visual Studio 2022 C++ standard libraries could not be found

I installed the visual studio 2022 community edition with a C++ Desktop development packageScreenshot of Visual Studio Installer. When a new console application

Modifying a member variable [closed]

I'm having an issue with modifying a member of a class. I overloaded the operators and I think that I am calling the member correctly to modif

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) {