Q:

Why is a char pointer dereferenced automatically in a dynamic array

Perhaps a stupid question. When I cout the pointer to the char array, I thought it would print an address; instead it dereferences the address and prints the actual values till null.
As opposed to an int array where it does what I expect it to. It prints the address of the first element.
Why does the char element gets dereferenced when you print the pointer.
char* as = new char[100];
    as[0] = 'a';
    as[1] = 'b';
    as[2] = NULL;
    cout << as << endl;

    int* s = new int[100];
    s[0] = 2;
    cout << s << endl;

Asking this because when I try to get the address to the first char element a[0] = 'a';. I have to store it in a pointer to a pointer. Which seems weird to me but that's besides the point.
char ** d = &as;
    cout << d << "this is d" << endl;

A:

There is no overloaded output operator << that prints the address for any char pointer, it treats all  char pointers as strings. If you want to print the address of a pointer, you need to cast it to void*
std::cout << "Address of string is " << static_cast<void*>(as) << '\n';

On a side-note, the code
char ** d = &as;
cout << d << "this is d" << endl;

will not print the address of the string, i.e. the pointer contained inside as, instead it will print where the variable as is stored in memory. Not quite the same thing.

