(c + +) Assertion failed:! " Bad error code ", file Vmem.c, line 715

Source: Internet
Author: User

(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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.