0Pricing
C Academy · Lesson

Strings in C

Discover how strings are implemented in C using character arrays and how to manipulate them using built-in functions like strlen, strcpy, strcat, and strcmp.

1

Strings in C

In C, strings are sequences of characters stored in character arrays and terminated by a null character \0.

In this lesson, you will learn:

  • How to declare and initialize strings.
  • How to manipulate strings using standard functions.
  • The difference between character arrays and string literals.
Strings in C — illustration 1

2

Declaring a String

A string in C is declared as a character array.

Example:

char name[10];

This creates an array that can store a string of up to 9 characters plus the null terminator \0.

All lessons in this course

  1. Introduction to Arrays
  2. Multidimensional Arrays
  3. Strings in C
← Back to C Academy