No video

fgets is unsafe! So what’s the alternative?

  Рет қаралды 2,899

Code With Huw

Code With Huw

Жыл бұрын

fgets is often described as a “safe” C function - one you should use instead of gets or scanf.
But is it really safe?
The plain answer is: NO. You can very easily corrupt data by reading unintended characters from the command prompt using fgets, as I explain in this video.
In previous videos I’ve already shown that standard C line-reading functions are unsafe so if fgets is unsafe too, what should you use instead?
In this lesson, I explain the problems and suggest some solutions.
To follow the course in order, bookmark the playlist:
• Program C in Visual St...
PROGRAMMING BOOKS
====================
If you want to learn C in more depth (and also support this channel!) you might think of buying one of my books. I have written books on C programming, Using Pointers in C, Recursion and other programming topics.
** The Little Book Of C Programming **
Amazon (US) amzn.to/2RXwA6a
Amazon (UK) amzn.to/2JhlwOA
GET THE SOURCE CODE
=================================
Download the source code of the projects in this course (the archive for “The Little Book Of C”) from:
www.bitwisebook...
“CODE WITH HUW” ON TWITTER:
=================================
/ codewithhuw
“CODE WITH HUW” ON FACEBOOK:
=================================
/ codewithhuw
Good luck! And good programming!

Пікірлер: 19
The ONE Thing Most C Programmers Get Wrong!
11:02
Code With Huw
Рет қаралды 31 М.
Learn Any Programming Language In 3 Hours!
22:37
Code With Huw
Рет қаралды 338 М.
My Cheetos🍕PIZZA #cooking #shorts
00:43
BANKII
Рет қаралды 24 МЛН
Joker can't swim!#joker #shorts
00:46
Untitled Joker
Рет қаралды 38 МЛН
Lehanga 🤣 #comedy #funny
00:31
Micky Makeover
Рет қаралды 27 МЛН
Stay on your way 🛤️✨
00:34
A4
Рет қаралды 32 МЛН
Master Pointers in C:  10X Your C Coding!
14:12
Dave's Garage
Рет қаралды 297 М.
Be Careful When Using scanf() in C
12:22
NeuralNine
Рет қаралды 127 М.
why do header files even exist?
10:53
Low Level Learning
Рет қаралды 389 М.
Scanf Basics: the good, the bad, and why so many pointers?
15:07
Jacob Sorber
Рет қаралды 23 М.
the cleanest feature in C that you've probably never heard of
8:13
Low Level Learning
Рет қаралды 133 М.
Compilers, How They Work, And Writing Them From Scratch
23:53
Adam McDaniel
Рет қаралды 146 М.
My 2 Year Journey of Learning C, in 9 minutes
8:42
VoxelRifts
Рет қаралды 588 М.
Strings can get you hacked! (buffer overflows, strcpy, and gets)
9:04
why do hackers love strings?
5:42
Low Level Learning
Рет қаралды 405 М.
My Cheetos🍕PIZZA #cooking #shorts
00:43
BANKII
Рет қаралды 24 МЛН