I just was wondering why the array its self are a pointer to the first element?
and what is the difference between an array and a pointer?
laconstantine 0 Junior Poster in Training
Recommended Answers
Jump to PostI just was wondering why the array its self are a pointer to the first element?
and what is the difference between an array and a pointer?nice question!
first, i want you to read a definition of arrays,
An array is an example of a homogeneous random …
Jump to Postso when we declare an array:
int arr[2] = {2,3};
we are taking some bytes "as a memory block"
then creating a pointer called 'arr' and pointing him to the block.i think you are getting it wrong here. arr is not a pointer, it is the array (the 'block' …
Jump to Postpart of the reason for you confusion is that you are trying out code with a. sizeof of the element (int) happens to be the same as the size of a pointer on your implementation. b. there are just two elements in the array.
try playing around with
Jump to Post>Not necessarily. There's no guarantee that the address of the array as a whole is the same as the address of the first element. That's usually the case though.
Its right, but you wouldnt call the array itself because they have different values, so the first value of the …
Jump to PostYes.
All 27 Replies
Narue 5,707 Bad Cop Team Colleague
Salem 5,265 Posting Sage
laconstantine 0 Junior Poster in Training
Narue 5,707 Bad Cop Team Colleague
iTaChi 19 Newbie Poster
~s.o.s~ commented: Good one. +19
laconstantine 0 Junior Poster in Training
Narue 5,707 Bad Cop Team Colleague
laconstantine 0 Junior Poster in Training
Narue 5,707 Bad Cop Team Colleague
laconstantine 0 Junior Poster in Training
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster
vijayan121 1,152 Posting Virtuoso
laconstantine 0 Junior Poster in Training
vijayan121 1,152 Posting Virtuoso
vijayan121 1,152 Posting Virtuoso
Narue 5,707 Bad Cop Team Colleague
vijayan121 1,152 Posting Virtuoso
laconstantine 0 Junior Poster in Training
Narue 5,707 Bad Cop Team Colleague
laconstantine 0 Junior Poster in Training
iTaChi 19 Newbie Poster
Narue 5,707 Bad Cop Team Colleague
laconstantine 0 Junior Poster in Training
Narue 5,707 Bad Cop Team Colleague
laconstantine 0 Junior Poster in Training
Narue 5,707 Bad Cop Team Colleague
newprog 0 Newbie 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.