I am a beginner student in c++ and there is one thing I cannot understand when working with character arrays: So, I know that pointers are essentially variables that "point" to the memory address of another variable, and that the name of an array(Ex: int a[20]) is a constant pointer to the values in that array. When working with different numeric types(int, float etc.) if we output through a message the name of that array it shows the address of the first element, but if we do the same with a char type, it doesn't show the address, but the value of the variable. Example:
#include <iostream>
using namespace std;
int main()
{int a[]={1,2,3,4,5};
cout<<a<<endl; //through output, it shows the memory address of the first
element of the array;
char b[]={"Mountain"};
cout<<b; //It outputs the word "Mountain"
return 0;
}
Is the pointer from a char array automatically converted to its value when you output it?