Why are `&array` and `array` pointing to the same address?

Why are `&array` and `array` pointing to the same address?

Until now, I thought an array is the same as a pointer. But I found a weird case:

Until now, I thought an array is the same as a pointer. But I found a weird case:

code

int array[5] = { 10,11,12,13,14};

std::cout << array << std::endl; std::cout << &array << std::endl; std::cout << &array[0] << std::endl;

int *pArray = new int[5];

std::cout << pArray << std::endl; std::cout << &pArray << std::endl; std::cout << &pArray[0] << std::endl;

output

0x7ffeed730ad0
0x7ffeed730ad0
0x7ffeed730ad0

0x7f906d400340 0x7ffeed730a30 0x7f906d400340

As you can see array and &array have the same value. But pArray and &pArray have different value. If array is same as pointer, address of array should be different from array. How can arrayand &array be the same? If array and &array are same, what is the address of the memory which holds the array values?

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Increased array size. after increaseSize function some arguments of the same array are invalid. C lang

The program takes some txt input from "numbers.txt" file. It first counts the&nbsp;<strong><em>amount</em></strong>&nbsp;of all the numbers (freqCount)in that text file, than reads the file again and with the use of malloc it creates two arrays A and B , of which both have size equal to the&nbsp;<strong>amount</strong>&nbsp;of all the numbers in the text file. So far so good.

C/C++ vs. Rust: A developer’s perspective

In this post, you'll see the difference between Rust and C/C++ in a developer’s perspective