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 149 views
1 answer 106 views
1 answer 169 views
1 answer 168 views
2 answers 208 views
2 answers 150 views
2 answers 138 views
...