<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/c-strings-are-terrible--qonzcxsno" -->

---
title: C Strings are Terrible! | daily.dev
description: C strings are null-terminated byte arrays with no built-in length, making operations like right-trimming destructive or requiring heap allocation. The post...
canonical: https://daily.dev/posts/c-strings-are-terrible--qonzcxsno
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: C Strings are Terrible! | daily.dev
og:description: C strings are null-terminated byte arrays with no built-in length, making operations like right-trimming destructive or requiring heap allocation. The post...
og:url: https://daily.dev/posts/c-strings-are-terrible--qonzcxsno
og:image: https://api.daily.dev/og/posts/QoNzcxsNo.png
og:image:alt: C Strings are Terrible!
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# C Strings are Terrible!

**[YouTube](https://daily.dev/sources/youtube)** · 28 min read · 0 upvotes · 0 comments

## Summary

C strings are null-terminated byte arrays with no built-in length, making operations like right-trimming destructive or requiring heap allocation. The post walks through C string internals (pointer arithmetic, read-only data sections, segfaults) and then introduces the string view pattern — a struct holding a pointer and a length — as a superior alternative. Practical implementations of chop-left, chop-right, trim, and split-by-delimiter are built step by step, demonstrating zero-allocation string manipulation. The post concludes that while string views are far better, null-terminated strings are baked into libc and OS syscall interfaces, so developers must still convert between the two.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=y8PLpDgZc0E>

## Similar posts on daily.dev

- [C Strings: A 50-Year Mistake](https://daily.dev/posts/c-strings-a-50-year-mistake-2lroff1nj) · Lobsters · 5 upvotes · 0 comments

---

Tags: [#c](https://daily.dev/tags/c)

[View this post on daily.dev](https://daily.dev/posts/c-strings-are-terrible--qonzcxsno)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"C Strings are Terrible!","url":"https://daily.dev/posts/c-strings-are-terrible--qonzcxsno","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/c-strings-are-terrible--qonzcxsno"},"datePublished":"2026-03-26T13:00:26.939Z","dateModified":"2026-03-26T13:00:48.443Z","description":"C strings are null-terminated byte arrays with no built-in length, making operations like right-trimming destructive or requiring heap allocation. The post...","image":"https://i.ytimg.com/vi/y8PLpDgZc0E/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/y8PLpDgZc0E/sddefault.jpg","isAccessibleForFree":true,"articleSection":"YouTube","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"YouTube","logo":"https://media.daily.dev/image/upload/s--W5zMumpP--/f_auto/v1725350181/logos/youtube","url":"https://daily.dev/sources/youtube"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/c-strings-are-terrible--qonzcxsno","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"c","timeRequired":"PT28M","video":{"@type":"VideoObject","name":"C Strings are Terrible!","description":"C strings are null-terminated byte arrays with no built-in length, making operations like right-trimming destructive or requiring heap allocation. The post...","thumbnailUrl":"https://i.ytimg.com/vi/y8PLpDgZc0E/sddefault.jpg","uploadDate":"2026-03-26T13:00:26.939Z","duration":"PT28M","url":"https://api.daily.dev/r/QoNzcxsNo","embedUrl":"https://www.youtube.com/embed/y8PLpDgZc0E"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"YouTube","item":"https://daily.dev/sources/youtube"},{"@type":"ListItem","position":3,"name":"C Strings are Terrible!"}]}
```

