Is there a difference between:
char string = "name";
const char* point = string;
vs
const char string[] = "name";
Will you please explain the difference too?
Is there a difference between:
char string = "name";
const char* point = string;
vs
const char string[] = "name";
Will you please explain the difference too?
Yes.
The first simply points to a read only section of memory, the declaration really should be:
const char* string = "name";
The second creates an array long enough to hold the string "name"
(so, four characters plus one for the null terminator) and copies the string inside the allocated space.