You seem to not know the basics of pointers and string literals in C/C++.
I suggest to work through some tutorial on C/C++, e.g.,
Character Sequences[
^] and
Pointers[
^]. Or even better, go through all parts of the
C++ Language[
^] tutorial (or any similar reference).
For the particular case:
1.
"hello"
is a sequence of 6 characters: h,e,l,l,o plus the terminating zero character.
2. that sequence of characters is accessible through the memory address of the first character of the sequence
3. that address is stored in a pointer variable
4. in C/C++ you write a pointer to a type as
type * var = ...;
, e.g.
char * s = "hello";
5. naming a
pointer to character as
ch
is fooling everyone - name it
greeting
or alike
Cheers
Andi