Check if the vector is empty

Suman Barik
0
// CPP program to illustrate
// Implementation of empty() function
#include <iostream>
#include <vector>
using namespace std;

int main()
{
vector<int> myvector{};
if (myvector.empty())
{
cout << "True";
}
else {
cout << "False";
}
return 0;
}

Tags

Post a Comment

0Comments
Post a Comment (0)