String Data Structure

  • Last Updated : 08 May, 2023

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’.
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


Topics:

Introduction:

String in different language:

Basic Operations of String:

Binary String:

Substring & Subsequence:

Palindrome:

Pattern Searching:

Standard problems on String: