C++ Program To Print Address of An Array Using Pointer

Problem:- Address of an array using pointer in c++ or C++ Program To Print Address An Array Using Pointer or c program to display array elements using pointers or c++ program to display array elements using pointers or write a c++ program to display address of elements of an array using both array and pointers or c++ program to print address of an array or address of array element in c or address of array elements in c++.

Check This:- Hacker rank solution for Strings, Classes, STL, Inheritance in C++.

Explanation:- address of array element in c++, we have to print the address of an array(an array each variable of an array) or we have to display the memory location of each element of an array we can do this by adding "address of" or "&" operator. Ths "&" operator returns the address of a variable in a memory location. or we can do this by using a pointer for that we have to transfer all array elements to pointer one by one and print the pointer value as we know that pointer is a variable that holds the address of another variable so each time in a Loop we assign the array value to a pointer and print the value of hold by pointer.

Also Check:- Geeksforgeeks solution for School, Basic, Easy, Medium, Hard in C++.

Extreme Recommended:- If this post is beneficial for you and you want Updates for New post then please like our Facebook Page or Join our Facebook Group and Google plus Community for up-to-date for a new post or if you have any Query you can ask there with lots of coders also suggest to your Friends to join and like our page, so we can help our community, and don't forget to Subscribe. Enter your Email and click to subscribe.


using namespace std;

int main()
/*visit - www.programmingwithbasics.com*/
int i, size;
cout<<"Enter The Size of The Array ";
    int array[size];
    int *ptr;
cout << "Enter The Elements Of An array";
for (i = 0; i < size; i++) 
cout << "Displaying An Address Using An Arrays";    
for (i = 0; i < size; i++) 
        cout << "Address Of " << array[i]<<" Using Array is ===> " << &array[i]<<endl;    

cout << "Displaying An Address Using Pointers";
    for (i = 0; i < size; i++) 
ptr = &array[i];   // ptr = &a[0]
        cout << "Address Of " << array[i] << " Using Pointers is ===> "<<ptr<<endl;
    return 0;


Address of an array using pointer in c++

You May Like This

1. C++ Program To Convert A Lower Case To Upper Case

2. C++ Program To Print Reverse A Sentence

3. C++ Program To Print A Full String Input By Keyboard

4. C++ Program For Reading A No. From File And Sum Of No. Line By Line Using File

5. C++ Program For Count A Character In File Using File

6. C++ Program To Display The List Of Current Directory/Folder Using File

7. C++ Program For Copy One File To Another Using File Handling

8. C++ Program To Merge Two File Into the Third File Using File Handling

9. C++ Program For Count A Words In Given String Even Enter No Of Space's Between String

10. C++ Program To Print A Pascal Triangle

Previous Post
Next Post

post written by:

Hi, I’m Ghanendra Yadav, SEO Expert, Professional Blogger, Programmer, and UI Developer. Get a Solution of More Than 500+ Programming Problems, and Practice All Programs in C, C++, and Java Languages. Get a Competitive Website Solution also Ie. Hackerrank Solutions and Geeksforgeeks Solutions. If You Are Interested to Learn a C Programming Language and You Don't Have Experience in Any Programming, You Should Start with a C Programming Language, Read: List of Format Specifiers in C.
Follow Me

1 comment: