It is not entirely clear what you are looking to do, but a string in C is actually a char *, terminated by the NUL character '\0'. In other words, a single char is a character–where a string is an array of char.

As an example, the following are equivalent definitions of strings.

char hello[6] = {'H', 'e', 'l', 'l', 'o', '\0'};
char hello[] = "Hello";

Note that in hello[size], in this case size = 6, size needs to be at least the size of the string, including the null terminator '\0'.

As I said previously, it is not completely clear what you are trying to do–if you want to build an array of strings (not the question asked) then I will gladly help you in doing so.

Tutorials on using strings and string.h are vastly available on the web, but I suggest you look for a more comprehensive C course (Harvard's CS50 is a good place to start, and is free).

Good luck,

Alexandre.

Answer from Alexandre Cassagne on Stack Overflow
🌐
GeeksforGeeks
geeksforgeeks.org › c language › array-of-strings-in-c
Array of Strings in C - GeeksforGeeks
July 23, 2025 - In C, an array of strings is a 2D array where each row contains a sequence of characters terminated by a '\0' NULL character (strings).
Discussions

Char array vs. char pointer array- specific question (noob learning C)
In C, strings are defined using char * or using a char array: char *name = “Zara Ali”; or char name[] = “Zara Ali”; In other words, a string is an array of characters. Your ‘names’ variable, however, is an array of strings. This means that ‘names’ is an array of an array of characters. You can define arrays using square bracket notation or with a *. So ‘char *names[]’ is a pointer to an array of chars. If you remove the * then C expects an array of characters and not an array of strings (an array of an array of characters). More on reddit.com
🌐 r/C_Programming
10
2
February 8, 2023
[C] printing out a character array returns gibberish
I think the issue is here c = (pos + k) % 26; a-z are not the only characters in ascii, there are others too and some one them are non-printable. You may want to limit this between 97-122 for lower case alphabets More on reddit.com
🌐 r/learnprogramming
3
2
November 19, 2015
How to properly store and use char array in C / Arduino
I'm no C standard expert (and definitely not an Ardino expert - does it use vanilla C or their own dialect?) but I don't think you can have an array of structs that use a flexible array member. You could make jokesList an array of pointers to Joke and change the initializers/access syntax accordingly. More on reddit.com
🌐 r/C_Programming
9
2
August 17, 2024
'\n' as a character in a 2d array : r/C_Programming
🌐 r/C_Programming
🌐
Scaler
scaler.com › home › topics › what is character array in c?
What is Character Array in C? - Scaler Topics
October 10, 2025 - The name depicts the name of the character array and size is the length of the character array. The size can be greater than the length of the string but can not be lesser. If it is lesser then the full string can't be stored and if it is greater the remaining spaces are just left unused. Before seeing the example, let us understand the method of dynamic memory allocation which is used to create the dynamic array. Dynamic memory allocation is an efficient way to allocate memory for a variable in c.
🌐
W3Schools
w3schools.com › c › c_strings.php
C Strings
For example, "Hello World" is a string of characters. Unlike many other programming languages, C does not have a String type to easily create string variables. Instead, you must use the char type and create an array of characters to make a string in C:
🌐
Quora
quora.com › How-do-I-initialize-a-char-array-in-C
How to initialize a char array in C - Quora
Let’s we have to initialize an array of size 20 with element 0 ... you can mix these two ways if you really want to (char charArray[] = "banana"), but normally char arrays are used when you use each character separately, and char pointers are normally used when the whole thing makes sense as a text.
Find elsewhere
🌐
W3Schools
w3schools.com › c › c_data_types_characters.php
C Characters
C Examples C Real-Life Examples C Exercises C Quiz C Code Challenges C Compiler C Syllabus C Study Plan C Interview Q&A C Certificate ... The char data type is used to store a single character.
🌐
GeeksforGeeks
geeksforgeeks.org › c language › find-the-length-of-character-array-in-c
Find the Length of Character Array in C - GeeksforGeeks
July 23, 2025 - In C, a character array is a collection of elements of the ‘char’ data type that are placed in contiguous memory locations and are often used to store strings. The length of a character array is defined as the total number of characters present in the array, excluding the null character ('\0') at the end.
🌐
YouTube
youtube.com › engineer man
Working with character arrays and "strings" in C - YouTube
Learn some basics on character arrays and strings in C. Learn how to declare, modify, output, and manipulate character arrays and C strings. Hope you enjoyed...
Published   June 5, 2017
Views   15K
🌐
IBM
ibm.com › docs › en › i › 7.4.0
Initialization of character arrays
We cannot provide a description for this page right now
🌐
Quora
quora.com › How-do-I-read-and-write-a-character-array-in-the-C-language
How to read and write a character array in the C language - Quora
Answer: char arr[10]; scanf(“%s”,arr); // takes input from user Above command takes input in arr , input should not be more than 9 characters as character null is stored by system , which makes total characters as 10 , which is size of array.
🌐
YouTube
youtube.com › watch
C Programming Tutorial - Character Arrays - YouTube
In this #C #Programming #Tutorial I introduce #character #arrays.My social links:LinkedIn:https://www.linkedin.com/in/timothy-unkert/Teacher Pay Teachers Sto...
Published   December 31, 2021
🌐
LeetCode
leetcode.com › problems › string-compression
String Compression - LeetCode
After you are done modifying the input array, return the new length of the array. You must write an algorithm that uses only constant extra space. Note: The characters in the array beyond the returned length do not matter and should be ignored. Example 1: Input: chars = ["a","a","b","b","c...
🌐
IceCube
user-web.icecube.wisc.edu › ~dglo › c_class › array_ptr.html
C Class - Arrays, String Constants and Pointers
In C, an array of type char is used to represent a character string, the end of which is marked by a byte set to 0 (also known as a NUL character)
🌐
w3resource
w3resource.com › c-programming-exercises › array › index.php
C programming exercises: Array - w3resource
Test Data : Input the number of elements to be stored in the array :3 Input 3 elements in the array : element - 0 : 45 element - 1 : 25 element - 2 : 21 Expected Output : Maximum element is : 45 Minimum element is : 21 Click me to see the solution ... Write a program in C to separate odd and even integers into separate arrays.
🌐
Cplusplus
cplusplus.com › doc › tutorial › ntcs
Character sequences
The string class has been briefly introduced in an earlier chapter. It is a very powerful class to handle and manipulate strings of characters. However, because strings are, in fact, sequences of characters, we can represent them also as plain arrays of elements of a character type.
🌐
Medium
medium.com › @Dev_Frank › arrays-in-c-4f7dd9f1ed27
ARRAYS IN C. Array is a kind of data structure… | by Dev Frank | Medium
January 29, 2024 - 1. Integer Array: This declares an array named integerArray with a size of 5 and initializes it with the values 1, 2, 3, 4, and 5. ... 2. Float Array: Here, floatArray is an array of size 3 containing the floating-point numbers 2.5, 3.14, and 1.8. ... This declares a character array charArray with a size of 10 and initializes it with the characters 'H’, 'e’, 'l’, 'l’, 'o’, a space, 'C’, '!’, and a null terminator (`’\0’`), making it a string.
🌐
Studytonight
studytonight.com › c › string-and-character-array.php
String and Character Arrays in C Language | Studytonight
... String is a sequence of characters that are treated as a single data item and terminated by a null character '\0'. Remember that the C language does not support strings as a data type. A string is actually a one-dimensional array of characters in C language.