[Solved] push_back in the vector class in C++


Because you’re trying to put a Perceptron into a vector of ints.

Change your code to:

int m = 3;
int l = 4;
int k - 6;
std::vector<Perceptron> perceptrons; // This is the line that needs changing
for(int i = 0; i < k; i++){
    Perceptron Ki = Perceptron(m, l);
    perceptrons.push_back(Ki);
}

2

solved push_back in the vector class in C++