C ++ primer-array details

Source: Internet
Author: User
The length of the array 1 is fixed, and ProgramThe member cannot know the length of a given array.

2 If you want to change the length of the array, you can only create a larger new array, and then copy the elements of the original array to the new array space one by one.

3 compared with programs using the standard vector type, programs relying on built-in arrays are more prone to errors and difficult to debug.

4 In modern c ++, arrays are strictly restricted to internal use of the program. arrays are used only when the performance test shows that vector cannot meet the necessary speed requirements.

5. When accessing array elements with subscript, size_t should be used for the correct type of array objects.

6 when using arrays, you must ensure that the value is within the correct range.

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.