O'Reilly logo

C by Nikolaos D. Tselikas, George S. Tselikis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 10

Strings

Now that you’ve seen how to use single character data, it’s time to learn how to use strings. A string in C is a series of characters that must end with a special character, the null character. This chapter will teach you how to read and write strings and covers some of the most important string-handling functions in the C library.

String Literals

A string literal is a sequence of characters enclosed in double quotes. C treats them as character arrays. In particular, when a C compiler encounters a string literal, it allocates memory to store the characters of the string plus one extra character, to mark the end of the string. This special character is called the null character, and it is represented by the first character ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required