what is string in data structure

what is string in data structure

1 year ago 39
Nature

In computer programming, a string is a sequence of characters, either as a literal constant or as some kind of variable. It is generally considered a data type and is often implemented as an array data structure of bytes (or words) that stores a sequence of elements, typically characters, using some character encoding). A string can consist of alphabets, numbers, spaces, and special characters, and is often enclosed in double quotation marks. The difference between a character array and a string is that the string is terminated with a special character ‘\0’. Strings are immutable in many programming languages, meaning that they cannot be changed once they are created. Strings are used for a variety of purposes, including text processing, data representation, encryption and hashing, database operations, and web development. In C, a string can be referred to either using a character pointer or as a character array, and when strings are declared as character arrays, they are stored like other types of arrays in C. Strings are implemented in nearly every programming language, and are available as primitive types in some languages and as composite types in others).

Read Entire Article