@abhayg1602 they are both of char datatype, how are they different?
character arrays are stored at contigous memory locations, and if you have an array arr, and you do cout << arr this will give you the address of the first element of the array. This means that arrays also store the addresses, just like pointers do.
In dynamic memory allocation also, we use pointers to make use of the heap memory. I think you are getting confused about this thing, but they can be used interchangeablly in some cases. Do read about pointers and arrays in detail if this continues to confuse you, and let me know if there’s anything in particular that is bothering you.