hey guys I was just wondering what the following is called:
'/0'
Thanks.
hey guys I was just wondering what the following is called:
'/0'
Thanks.
It's an escape sequence. That particular one represents the null character.
Actually, '\0' is the escape sequence that represents the null character.
'/0' as the topic implies is a syntax error. Some compilers may just give a warning as a multi-character character constant.
Sent from my iPadŽ
Is it also known as a line terminator?
Thanks.
A line terminator is \nOriginally Posted by 182
Thanks,
Logan
\n is a line feed and a carriage return in one escape sequence. (Line feed moves the cursor down one, carriage return moves the cursor to the beginning of the line.)
\0 is a null character.
/0 is a divide by zero error.
'\0' is also known as the null-terminator, since in C it is used to mark the end of a string stored in a character array. Since in most cases you cannot determine the size of an array without saving that information (and even if you could, there's no guarantee that the string inside the array uses the whole thing), they use a special character to mark the end of the string. That character is '\0'.
Another way to handle strings is to save the size of the string along with the array data, which is how it is done in C++ string classes.