class
<new>
std::bad_array_new_lengthclass bad_array_new_length;
Exception on bad array length
Its member what returns a null-terminated character sequence identifying the exception.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// bad_array_new_length example
#include <iostream> // std::cout
#include <exception> // std::exception
#include <new> // std::bad_array_new_length
int main() {
try {
int* p = new int[-1];
} catch (std::bad_array_new_length& e) {
std::cerr << "bad_array_new_length caught: " << e.what() << '\n';
} catch (std::exception& e) { // older compilers may throw other exceptions:
std::cerr << "some other standard exception caught: " << e.what() << '\n';
}
}
bad_array_new_length caught: bad array new length
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4