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.
Review the options below to login to check your access.
Log in with your Cambridge Aspire website account to check access.
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.