What really means by word “C-string” in C / C++? Pointer to char? Array of characters? Or maybe const-pointer / const array of characters?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A “C string” is an array of characters that ends with a 0 (null character) byte. The array, not any pointer, is the string. Thus, any terminal subarray of a C string is also a C string. Pointers of type
char *(orconst char *, etc.) are often thought of as pointers to strings, but they’re actually pointers to an element of a string, usually treated as a pointer to the initial element of a string.