Skip to main content Accessibility help
Internet Explorer 11 is being discontinued by Microsoft in August 2021. If you have difficulties viewing the site on Internet Explorer 11 we recommend using a different browser such as Microsoft Edge, Google Chrome, Apple Safari or Mozilla Firefox.

Chapter 12: String Handling

Chapter 12: String Handling

pp. 268-319

Authors

, Techno India Hooghly, West Bengal, , Techno India College of Technology, West Bengal
  • Add bookmark
  • Cite
  • Share

Extract

In the last chapter, we discussed about single and multi dimensional array. We already learnt how to define arrays of different sizes and dimensions, how to initialize them, how to operate on arrays of different dimensions, etc. With this knowledge, we are ready to handle strings, which are, simply a special kind of array. String handling basically consists of:

Σ Input and output strings from/to keyboard/monitor or files.

Σ Copying and comparing strings with library functions.

Σ Finding substrings, determining length, extracting substring, concatenating strings with library functions.

Σ Manipulating case of characters in a string with library functions.

Σ Writing equivalent functions of string manipulating library functions.

We will discuss all important string manipulating library functions in this chapter; however a complete list of string manipulating library functions along with explanation is given in Appendix.

We will learn to write equivalent functions of string manipulating library functions in functions chapter.

STRING

A string is a sequence of characters terminated with a null character (‘\0’). It is usually stored as one-dimensional character array. A set of characters arranged in any sequence defined within double quotation is known as string constant. To manipulate text such as words and sentences, strings, i.e., character arrays are used. The way a group of integers can be stored in an integer array, is similar with a group of characters stored in a character array.

About the book

Access options

Review the options below to login to check your access.

Purchase options

Paperback
US$105.00

Have an access code?

To redeem an access code, please log in with your personal login.

If you believe you should have access to this content, please contact your institutional librarian or consult our FAQ page for further information about accessing our content.

Also available to purchase from these educational ebook suppliers