samedi 25 avril 2020

Unable to define push_back in vectors

Here I had defined the push_back an was using it in my code but don't know after doing this below task.

#include<bits/stdc++.h>
using namespace std;

#define pb push_back
vector<int> v[1001];

Here is the below error of this

prog.cpp:4:12: error: request for member ‘push_back’ in ‘v’, which is of non-class type ‘std::vector<int> [1001]’
 #define pb push_back

Aucun commentaire:

Enregistrer un commentaire