How many bytes does int **a[3][4] occupy?

Source: Internet
Author: User

The first thing to explain
int **a[3][4]
Defines a set of two-dimensional pointer arrays that point to pointer variables.
That is, a 3-row, 4-column array of pointers is defined, each pointing to a pointer,
From the storage structure, it is an array that stores 12 pointer variables.
The question is, what is the number of bytes "A" that the Lord says? ”
What's a in here, exactly?
The actual meaning of a is an address that represents A[3][4] the first address of this array,
For a as a single address, it occupies 4 bytes;
At the same time A is a[3][4] This array is a representation,
If you use sizeof (a) to solve it, it represents the space occupied by the a[3][4] array,
Instead of the storage space that an address occupies,
This is the space occupied by 12 pointer variables, which is naturally 48 bytes.
64 bits A pointer is 8 bytes, and 32 bits A pointer takes up 4 bytes.

How many bytes does int **a[3][4] occupy?

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.