Problem with C-string - C++

Problem with C-string.

C-string cannot contain 0 as a character in them. C-strings are essentially null terminated strings; hence the 0 contained in them is considered as end of the string. They cannot hold 0 as character in them. Whenever 0 is encountered, that is considered as end of the string. This does not happen when we use string class provided by C++. Thus, not being able to store 0 as one of the characters in the array is a problem with C-strings.
Difference between struct and class in terms of Access Modifier
Difference between struct and class - All members of a class are private by default, whereas fields of a struct are public.....
What is private, public and protected inheritance?
What is private, public and protected inheritance? - The Public and protected members of Base class become private members of the derived class....
Describe abstract base class - C++
Describe abstract base class - A pure virtual function is a function which does not have definition of its own..
Post your comment
Discussion Board
C-String
This is entirely wrong. The termination character is \0 or NUL (ASCII character 0), you can still have a 0 in your char array as this is ASCII character 0x30 so it is a totally different value.
Dan 09-19-2016