C Language Strings

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!


In C, a string is not an intrinsic type. A C-string is the convention to have a one-dimensional array of characters which is terminated by a null-character, by a '\0'.

This means that a C-string with a content of "abc" will have four characters 'a', 'b', 'c' and '\0'.

See the basic introduction to strings example.


  • char str1[] = "Hello, world!"; /* Modifiable */
  • char str2[14] = "Hello, world!"; /* Modifiable */
  • char* str3 = "Hello, world!"; /* Non-modifiable*/

Got any C Language Question?