I am a student studying C++ and recently studied about pointers. Here is a code written by me and I am having trouble explaining myself the output I get
int main()
{
char *names[]={"abc", "def", "ghi", "jkl", "mno"};
cout << (names[0]);
return 0;
}
Now , here I have made an array of pointers and the first pointer should point at the first element of the first string i.e to a and that it is doing. But when I want to cout the pointer instead of giving the address of a, it is printing abc.
I am not able to find the reason behind this and so it would be really helpful for me if someone can explain me this.