#include<iostream>
using namespace std;
int main()
{
char a[5];
cout << sizeof(a) << endl <<&a[0] << endl <<&a[1] << endl <<&a[2] << endl <<&a[3] << endl <<&a[4] << endl <<&a[5];
return 0;
}
This will return something like this
5
@
░→@
but when you does the same with
#include<iostream>
using namespace std;
int main()
{
int a[5];
cout << sizeof(a) << endl <<&a[0] << endl <<&a[1] << endl <<&a[2] << endl <<&a[3] << endl <<&a[4] << endl <<&a[5];
return 0;
}
it will return you with this
20
0x61fefc
0x61ff00
0x61ff04
0x61ff08
0x61ff0c
0x61ff10
I'm unable to find it on the internet or any c++ reference book.
Compiler is "Mingw"
I run the code using compiler "Mingw" but the code does not gives result as it is given in most of the reference books or youtube videos when my type is char.