15
Working with Strings
In C, a string is an array with two special properties. First, a string is made up of only characters. Second, the string must conclude with an essential terminating character – the NUL character. While some would say strings are one of C's weakest features, I disagree with that assessment. Because strings build on already-established mechanisms, I believe that they are rather elegant in an unexpected way.
Not all values that we might want to manipulate in a program are numbers. Often, we need to manipulate words, phrases, and sentences; these are built from strings of characters. We have been getting output using simple strings in printf() statements. To input strings and numbers, we need to be able to manipulate strings ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access