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 220 views
1 answer 209 views
1 answer 240 views
1 answer 257 views
2 answers 323 views
2 answers 249 views
2 answers 249 views
...