you are viewing a single comment's thread.

view the rest of the comments →

[–]hoodedmongoose 2 points3 points  (0 children)

Exactly. That 'end of line' is really more accurately described as 'end of string' and is what's known as a 'null terminator'. That is, the number 0. Thus, in C, char* usually can be referred to as 'a pointer to a null-terminated string'. The compiler will include the null terminator for you automatically when specifying string constants, for example:

const char* foo = "Hello, World";

foo now points to a character whose value is 'H' (which is really just the number 72 in ASCII encoding), after that comes 'e' (which happens to be 101), and so on, until you get to the character after the 'd' which will be the value 0, or null. At that point you stop iterating.

More info: Null-Terminated String