String Data Structure

  • Last Updated : 06 Feb, 2023

Learn more about String in DSA Self Paced Course
Practice Problems on String
Recent Articles 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

‘Recent Articles’ on Strings

Topics:

Introduction:

String in different language:

Basic Operations of String:

DSA-Self-Paced
Binary String:

Substring & Subsequence:

Palindrome:

Pattern Searching:

Standard problems on String:

Quick Links:

Recomended:

If you like GeeksforGeeks and would like to contribute, you can also write an article and mail your article to review-team@geeksforgeeks.org. 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.


My Personal Notes arrow_drop_up