(c + +) Assertion failed:! " Bad error code ", file Vmem.c, line 715
Misc error.
Full error message
Assertion failed: !"Bad error code", file VMem.c, line 715
|
- View A screenshot of this error message
Cause
Ide:c++ Builder 6.0
Project TYPE:VCL
Appears when linking the following code:
#define ARRAY_SIZE 10000000
int main()
{
int array[ARRAY_SIZE];
}
|
Solutions
When this error occurs, restart C + + Builder and nothing have been lost. The code as in one of the examples below.
Decrease the value of the array size
#define ARRAY_SIZE 1000000
int main()
{
int array[ARRAY_SIZE];
}
|
Create the array dynamically
#define ARRAY_SIZE 10000000
int main()
{
int * const array = new int(ARRAY_SIZE);
}
|
Use a std::vector (preferred)
#include <vector>
int main()
{
const int sz = 10000000;
std::vector<int> v(sz);
}
|
Go back to Richel Bilderbeek ' s C + + page.
Go back to Richel Bilderbeek ' s homepage.
(c + +) Assertion failed:! " Bad error code ", file Vmem.c, line 715