Take the 2-minute tour ×  So I've been watching lectures from a
University about C++, and I'm learning a lot, but one thing I
still cannot understand is this:  Why do you have to do this
sometimes?  char* test = "testing";  From what I've
read/watched, I just don't understand why you have to put the *.
From what I thought I understood, you only use * if you have an
address, but maybe I'm just dead wrong.  share|improve this
question This isn't strictly correct, you should say const char
* test = "testing";. String literals are pointers to constant
chars. –  Kerrek SB Jul 25 '11 at 22:48 @Kerrek: Actually,
string literals are constant char arrays which can decay into
pointers to constant chars. –  fredoverflow Jul 25 '11 at 23:02
@Fred: Yes, even better! –  Kerrek SB Jul 25 '11 at 23:13  7
Answers 7  up vote 10 down vote accepted  This is a char:  char
c = 't';  It can only hold one character at a time! :)  This is
a C-string:  char sz[] = "test";  It can "hold" more than just
one character.  A char* points to