the address of the array is contained in the array name that is a pointer to the array it means when we are declaring an integer array a[5] we are getting 10 bytes for the array elements and two bytes for the pointer a?
means 12 bytes are occupied in fact
is it so and i just want to confirm to store a address(pointer variable) how many bytes we require is it 2 bytes?
boyz
-8
Light Poster
Recommended Answers
Jump to Post> means 12 bytes are occupied in fact
Nope, guess again.
Arrays are not pointers.
Jump to Postif you have a[10]
a refers to the address of the first element of the array
so you will have 10 * sizeof(int) bytes occupied by the array.
All 6 Replies
Salem
5,138
Posting Sage
doublex
1
Newbie Poster
doublex
1
Newbie Poster
rajusankar28
0
Newbie Poster
Jishnu
160
Posting Pro
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.