#include
using namespace std;
int main()
{
int a[10];
cout<<&a<<endl;
cout<<a;
}
this code gives the same address how ??
#include
using namespace std;
int main()
{
int a[10];
cout<<&a<<endl;
cout<<a;
}
this code gives the same address how ??
hello @ranahiten8
yeah they will give same address(but type of address will be different , “ a ” is a “ pointer to the first element of array ” but “ &a ” is a “ pointer to whole array of 10 int ”).
variable are nothing but name of given to address .
here a is array name given to 10 size array.
if print &a that will print the starting address which in case same as a (name of array holds first index address)