16

CHAPTER

Working with Strings

CHAPTEROUTLINE —•  16.1 Introduction
—•  16.2 Moving from C String to C++ String
—•  16.3 Declaring and Initializing String Objects
—•  16.4 Relational Operators
—•  16.5 Handling String Objects
—•  16.6 String Attributes
—•  16.7 Accessing Elements of Strings
—•  16.8 Comparing and Exchanging
—•  16.9 Miscellaneous Functions

16.1 INTRODUCTION

A string is nothing but a sequence of characters. String can contain small and capital letters, numbers and symbols. String is an array of character type. Each element of string occupies a byte in the memory. Every string is terminated by a null character. The last character of such a string is null (‘\0’) character and the compiler identifies the ...

Get Object-Oriented Programming with ANSI and Turbo C++ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.