Array of Strings in C | 2D Character Arrays, Input & Accessing Strings @LearningLad
Array of Strings in C | 2D Character Arrays, Input & Accessing Strings  @LearningLad
Uploaded September 2026 | Updated November 2026, 1 day ago
Learn how to create and use an Array of Strings in C programming using a Two-Dimensional Character Array.

In this tutorial, we first understand why a Character Array can store one String and how a Two-Dimensional Character Array can be used when we need to store multiple String values under one Array Name.

You will learn how to declare an Array of Strings by specifying the number of Strings and the space available for each String. We then initialize the 2D Character Array using individual characters as well as String Literals and understand why enough space must be available for the String Termination Character.

We also visualize the Array of Strings in terms of Rows and Columns. Each Row stores one String, while the Columns store the individual characters of that String. Since all rows in a Two-Dimensional Array have the same number of columns, some space may remain unused when Strings have different lengths.

Next, we use printf() with %s to access and display individual Strings and %c with Row and Column indexes to access a specific Character. We also use a For Loop to display all the Strings stored in the Array.

Then we take User Input for multiple Strings using scanf() and a Scanset. We limit the number of characters that can be read so that space remains for the String Termination Character. We also see how leading whitespace in the scanf() format string can discard leftover whitespace such as the Newline Character between successive inputs.

Finally, the tutorial introduces the idea of creating a Variable Length Array of Strings by taking the number of names and the maximum name length from the user.

Our Website
LearningLad.com

Social Media
Facebook facebook.com/LearningLad
Twitter twitter.com/LearningLadEdu
Instagram instagram.com/LearningLadOfficial
Array of Strings in C | 2D Character Arrays, Input & Accessing StringsC Calculator Program Using Do While Loop & Switch Statement | Beginner TutorialSize Modifiers in C Programming | Short, Long & Unsigned Integers ExplainedHow to Install Python on Windows 11 (Latest Version) | Step-by-Step Guide for BeginnersWhat is a Structures | How to define Structures | C Language TutorialHow to Install C C++ Compiler / Tool set  ( gcc g++ gdb Mingw w64 ) Easily in Windows 11 ComputerPointer Declaration in C | int *ptr vs int* ptr & Multiple Pointer VariablesReturn Statement in C Explained | return, Unreachable Code & break vs returnDefining Structures Variables in Different ways in C Programming Language | TutorialSquare Pattern Printing with Diagonals in C Programming Language TutorialHow to install NumPy SciPy Pandas Matplotlib libraries for Python in Windows 10typedef in C Explained | Type Aliases, Enums & Scope
LearningLad |

Array of Strings in C | 2D Character Arrays, Input & Accessing Strings

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER