So, my question again is, why a string is passed through a pointer (what does *str point at?) and since that it is stored in *str, why when you print it you print the variable not the pointer, and the pointer (e.g cout << *str;) gives you an "H".
A C string is an array of chars.
cout knows that so when you are passing to the << operator a pointer to char, it will print it as a null terminated C string http://www.cplusplus.com/doc/tutorial/ntcs/
Well I know that already, but how could the whole string is passed in *str, and str prints it (why not *str?). Since *str would point to the first index of the array, why do you pass the string "Hello!" to a pointer at the first place?
A quoted string ("Hello") ha a type of const char*, which is a character pointer pointing to the first element of the string. Read the article Bazzy posted.
because when you pass an array to a function, you are actually passing a pointer to the first index of the array. in this case "Hello!" is actually an array of chars.
and str prints it (why not *str?).
because *str is actually equal to *str[0] with a value of 'H' and output streams treats char* in special way, printing the values of the pointer terminated by a null character '\0' instead of the address the pointer it is pointing to
Since *str would point to the first index of the array, why do you pass the string "Hello!" to a pointer at the first place?
because pointer can be use to point other variables..