C Programming Tutorial - 35 - puts and gets

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

NOOOO WAYYY ! . Just found out my teacher always use Bucky's examples. Can't believe it I am paying her to teach me. Its not fair !! Bucky you are my heroo.

samantagjepali
Автор

Never use gets(), can lead to serious segmentation fault. Better Use fgets

fgets(catsName, 50, stdin);

here 50 is the size of the character array (could be any number) and "stdin" refers to the standard input (from keyboard)

stickydamper
Автор

I have been wathcing your tutorials and they've been helping me a lot to retrieve some stuff I learned back in school. Thak you very much!!

For this video I'd suggest the use of 'fgets()' insted, I heard that 'gets()' may add some weaknesses to your programm security. I understand these are introductive ( and very, very useful) tutorials, though.

Best!

filipe
Автор

Damn, this was very helpful. Didn't understand it from the book. This guy explained it so well :)

casualrich-lifeiseasy
Автор

warning: ‘gets’ is deprecated (declared at /usr/include/stdio.h:638) 

Looks like we have a problem...
Theres a similar one foe puts..
The code works but...

Team
Автор

what happened to the girl you were trying to talk to?>

nguyentuan
Автор

you explain logically and you would one of best teacher

uschan
Автор

I don't think I have ever heard any teacher carry on stories like this one about the cat that loves bagels before.
The closest I have seen to something like this in a course literature book is probably the "obnoxious cousin Throckmorton" in the physics book "University Physics With Modern Physics", who shows up in various physics problems throughout the book.

Peter_
Автор

Is puts and gets functions only useful when using strings? Is why we don't just use them instead of printf and scanf due to space usage?

Scetils
Автор

When your cats name is over 50 characters:(

icterinetech
Автор

Can you zoom in please? Thanks for educating us

stuartreilly
Автор

You should have to zoom in while recording, it's hardly visible!

diproy
Автор

I typed this code out, but I've noticed something odd. When I'm making the string variables, when I change the numbers, a bunch of random symbols come up in the output. For example when I use 50 for catsFood, instead of 25, a ">" comes up at the start of the sentence.

Ruairoquai
Автор

so why didnt we use put from the start instead of printf?

vestraya
Автор

I dont know if anyone noticed, or it may just be an accident, but the title that has pyts and gets and as the video talks about a cat, It kinda reminds me of the beginner beatboxing technique of saying "puts and cats'... LOL I know that was useless but if bucky did that on purpose, that's pretty cool!

hi-yqun
Автор

Does anyone know why he sets the "sentence" string to equal quotation marks in the begining?

mcstreamer
Автор

NEVER EVER USE GETS!! Do not use gets in C, its corrupt and causes lots of fatal bugs and memory leaks.

jacksonpark
Автор

use gets but my terminal keep giving me this message:
warning: this program uses gets(), which is unsafe.
Ned help

libvlog
Автор

every one says use fgets, but I am not sure how to use it...

DerSohnDesAlvaters
Автор

Why did the scanf command ("% d \ n") not have the command drift, when using gets

chungfup