<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/the-problem-with-c-tutorials-xlxr41agz" -->

---
title: The PROBLEM with C Tutorials | daily.dev
description: A creator critiques how popular tutorial sites (W3Schools, GeeksforGeeks, freeCodeCamp-style channels) and AI tools like Google's AI Overview and Gemini teach...
canonical: https://daily.dev/posts/the-problem-with-c-tutorials-xlxr41agz
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: The PROBLEM with C Tutorials | daily.dev
og:description: A creator critiques how popular tutorial sites (W3Schools, GeeksforGeeks, freeCodeCamp-style channels) and AI tools like Google's AI Overview and Gemini teach...
og:url: https://daily.dev/posts/the-problem-with-c-tutorials-xlxr41agz
og:image: https://api.daily.dev/og/posts/XLXR41agz.png
og:image:alt: The PROBLEM with C Tutorials
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.

# The PROBLEM with C Tutorials

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

## Summary

A creator critiques how popular tutorial sites (W3Schools, GeeksforGeeks, freeCodeCamp-style channels) and AI tools like Google's AI Overview and Gemini teach C string handling. The core complaint: these sources default to unsafe patterns like scanf("%s") without length limits and unbounded strcpy/strcat, rarely mention the safer bounded variants (fgets, strncpy, strncat), and even when they do, they show them with hardcoded static sizes rather than teaching how to calculate buffer sizes dynamically. The result is that beginners copying these examples verbatim produce classic buffer overflow bugs. The video also mocks W3Schools for charging $95 for a C certification built on these flawed examples.

## Full article

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

## Questions this post answers

### Why is using scanf("%s") to read a string in C considered unsafe?

Scanf with a raw %s format specifier and no width limit will write as many characters as the user types into a fixed-size buffer, causing a buffer overflow if input exceeds the buffer size. Many tutorials declare a buffer like char name[20] but never add a width limiter to the format string, so any input longer than the buffer overflows it. The fix is to either specify a width limit in the format string or use fgets instead, which takes a size argument and won't overflow the buffer.

_Developers hardening input parsing in C can find sharper explainers on daily.dev before shipping unsafe scanf calls._

### What is the difference between the n in strncpy/strncat and the n in snprintf?

The n parameter in strncpy and strncat specifies the maximum number of bytes to transfer, not the total destination buffer size, unlike snprintf where n represents the total buffer capacity. Using strncat correctly requires calculating available space as destination buffer size minus the length of the string already in the buffer minus one for the null terminator, a calculation most tutorials skip entirely.

_Anyone debugging strncat buffer math can compare C safety guidance side by side on daily.dev._

## Similar posts on daily.dev

- [How a 9-character string can crash your program](https://daily.dev/posts/how-a-9-character-string-can-crash-your-program-3hu22gmvv) · All Things Open · 0 upvotes · 0 comments
- [Fixing C Strings With String Views](https://daily.dev/posts/fixing-c-strings-with-string-views-sp384nwb3) · Lobsters · 0 upvotes · 0 comments
- [C Strings: A 50-Year Mistake](https://daily.dev/posts/c-strings-a-50-year-mistake-2lroff1nj) · Lobsters · 5 upvotes · 0 comments
- [C\+=0.25](https://daily.dev/posts/c-0-25-fbbk4rxps) · The Daily WTF · 5 upvotes · 0 comments

---

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

[View this post on daily.dev](https://daily.dev/posts/the-problem-with-c-tutorials-xlxr41agz)

```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":"The PROBLEM with C Tutorials","url":"https://daily.dev/posts/the-problem-with-c-tutorials-xlxr41agz","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/the-problem-with-c-tutorials-xlxr41agz"},"datePublished":"2026-09-12T18:08:52.350Z","dateModified":"2026-10-29T02:14:10.683Z","description":"A creator critiques how popular tutorial sites (W3Schools, GeeksforGeeks, freeCodeCamp-style channels) and AI tools like Google's AI Overview and Gemini teach...","image":"https://i.ytimg.com/vi/s9kctaY0Wl8/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/s9kctaY0Wl8/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/the-problem-with-c-tutorials-xlxr41agz","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"appsec,c,security","timeRequired":"PT10M","video":{"@type":"VideoObject","name":"The PROBLEM with C Tutorials","description":"A creator critiques how popular tutorial sites (W3Schools, GeeksforGeeks, freeCodeCamp-style channels) and AI tools like Google's AI Overview and Gemini teach...","thumbnailUrl":"https://i.ytimg.com/vi/s9kctaY0Wl8/sddefault.jpg","uploadDate":"2026-09-12T18:08:52.350Z","duration":"PT10M","url":"https://api.daily.dev/r/XLXR41agz","embedUrl":"https://www.youtube.com/embed/s9kctaY0Wl8"}}
{"@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":"The PROBLEM with C Tutorials"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/the-problem-with-c-tutorials-xlxr41agz#faq","mainEntity":[{"@type":"Question","name":"Why is using scanf(\"%s\") to read a string in C considered unsafe?","acceptedAnswer":{"@type":"Answer","text":"Scanf with a raw %s format specifier and no width limit will write as many characters as the user types into a fixed-size buffer, causing a buffer overflow if input exceeds the buffer size. Many tutorials declare a buffer like char name[20] but never add a width limiter to the format string, so any input longer than the buffer overflows it. The fix is to either specify a width limit in the format string or use fgets instead, which takes a size argument and won't overflow the buffer. Developers hardening input parsing in C can find sharper explainers on daily.dev before shipping unsafe scanf calls."}},{"@type":"Question","name":"What is the difference between the n in strncpy/strncat and the n in snprintf?","acceptedAnswer":{"@type":"Answer","text":"The n parameter in strncpy and strncat specifies the maximum number of bytes to transfer, not the total destination buffer size, unlike snprintf where n represents the total buffer capacity. Using strncat correctly requires calculating available space as destination buffer size minus the length of the string already in the buffer minus one for the null terminator, a calculation most tutorials skip entirely. Anyone debugging strncat buffer math can compare C safety guidance side by side on daily.dev."}}]}
```

