python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
Creating a std::vector of derived classes
Assume that I have an Abstract Class
class AbstractClass {
public:
virtual int get() const = 0;
};
and two different Derived classes
class DerivedClassA : public AbstractClass {
public:
int g...
Carmelo Evoli
Votes: 0
Answers: 2
Can anyone explain how to use unique( ) in the vector?
#include<bits/stdc++.h>
using namespace std;
int main() {
vector <int> v = {1, 2 , 3, 2 , 1};
cout << v[0] << " " << v[1] << " " <&l...
Chaitanya
Votes: 0
Answers: 1
C++ Store an expression template inside a class whose objects will be part of a vector
[Extensively edited for clarity and typos, and now with attempted solution, old version at the end]
New version of the question
I have a class which needs to store a functor. The problem is that the f...
marco
Votes: 0
Answers: 2
Convert Binary tree into linked list
Basically in this code, I am trying to make the individual linked list for each level of binary tree and store the address of each one in a vector, but when I am trying to print all the linked lists, ...
Amit khurrana
Votes: 0
Answers: 0