How to check whether fixed size array is empty in C++

1 Answer

0 votes
#include <iostream>
#include <array>

using namespace std;

int main() {
    array<int, 9> arr1;
    std::cout << arr1.empty() << "\n";
    
    array<int, 0> arr2;
    cout << arr2.empty();
}
 
 
 
/*
run:
 
0
1
 
*/

 



answered Dec 5, 2020 by avibootz

Related questions

1 answer 140 views
1 answer 97 views
1 answer 160 views
1 answer 161 views
2 answers 187 views
2 answers 141 views
2 answers 129 views
...