String Data Structure

Learn Data Structures and Algorithms | DSA Tutorial
Learn more about String in DSA Self Paced Course
Practice Problems on String

What is String?

Strings are defined as an array of characters. The difference between a character array and a string is the string is terminated with a special character ‘\0’.

String Data Structure

Below are some examples of strings:

“geeks”, “for”, “geeks”, “GeeksforGeeks”, “Geeks for Geeks”, “123Geeks”, “@123 Geeks”

How String is represented in Memory?

In C, a string can be referred to either using a character pointer or as a character array. When strings are declared as character arrays, they are stored like other types of arrays in C. For example, if str[] is an auto variable then the string is stored in the stack segment, if it’s a global or static variable then stored in the data segment, etc.

What is String & How String is represented in Memory

What is String & How String is represented in Memory



String in different language:

Basic Operations of String:

Binary String:

Substring & Subsequence:


Pattern Searching:

Standard problems on String:

Quick Links:


If you like GeeksforGeeks and would like to contribute, you can also write an article and mail your article to See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.

  • Last Updated : 01 Dec, 2023

Similar Reads