Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Illustrating the Relationship between Array and Pointers #1586

Open
11gurmeet11 opened this issue Aug 27, 2024 · 2 comments
Open

Illustrating the Relationship between Array and Pointers #1586

11gurmeet11 opened this issue Aug 27, 2024 · 2 comments

Comments

@11gurmeet11
Copy link

11gurmeet11 commented Aug 27, 2024

#include < iostream >

using namespace std;

int main()
{
// Defining an array
int arr[ ] = { 1, 2, 3, 4 };

// Define a pointer
int* ptr = arr;

// Printing address of the arrary using array name
cout << "Memory address of arr: " << &arr << endl;

// Printing address of the array using ptr
cout << "Memory address of arr: " << ptr << endl;

return 0;

}

Copy link

Hello @11gurmeet11, thanks for creating your first issue at LearnCPP, hope you followed the guidelines.

@Lakhankumawat
Copy link
Owner

Hi @11gurmeet11 , please go ahead and raise the PR, will talk there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants