Strange problems with gdbp arrays

Source: Internet
Author: User
The gdbp array encountered a strange problem-General Linux technology-Linux programming and kernel information. The following is a detailed description. Write a static array in C language:

Char s [10];

Then debug with gdb and use the p s command to display the array content, which is strange:

The array length is 10 and the element number should be 0-9. Why does gdb display only nine elements?
I used the x/11cb $1 Command to display the memory, and found that the tenth element seems to be in ......

Why does gdb do this?

Thank you for your help!

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.