C Programming Tutorial – 35 – puts and gets

Facebook – https://www.facebook.com/TheNewBoston-464114846956315/
GitHub – https://github.com/buckyroberts
Google+ – https://plus.google.com/+BuckyRoberts
LinkedIn – https://www.linkedin.com/in/buckyroberts
reddit – https://www.reddit.com/r/thenewboston/
Support – https://www.patreon.com/thenewboston
thenewboston – https://thenewboston.com/
Twitter – https://twitter.com/bucky_roberts

Comments

shizyninjarocks says:

Thanks so much. This clarified a ton of questions I had while going over my class notes. Keep the great videos coming, you magnificent bastard!

John Seed says:

Two counts of using deprecated function gets(), three counts of using insecure strcat(), totalling five counts of overflow vulnerabilities.  Should find someone who teaches better or it’ll come back around and bite you in the ass.

Mu'nisa says:

U r my hero !!! Thx

StarMedia StarMedia says:

Amazing code puts and gets :)

Christopher Robles says:

You are the fucking man!!!!!

GG says:

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

Umair Rehmat says:

How to enter a string via puts and not have a new line at the end?

Jhinuk Noman says:

why in the following code the strcat section doesn’t work .why ?

#include
#include
#include
#include
#include

int main()
{

char eatersname[15];
char foorname[15];
char sentence[100]=””;

puts(“enter eaters name”);
gets(eatersname);

puts(“enter foods name”);
gets(foorname);

strcat(sentence,eatersname);
strcat(sentence,”loves to eat”);
strcat(sentence,foorname);

return 0;
}

Ruairoquai says:

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.

atna mas says:

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.

Thomas Tuan Nguyen says:

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

Nosferatu says:

why didn’t you say that before man.

Mo's TV says:

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

Michal Pitr says:

Can you use variables inside of puts? like when I want to print out an int I got from the user before, or I gotta insert it into a string via strcat?

Dennis Liu says:

you are always the best explainer !!

jacksonpark1 says:

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

Michael Rayner says:

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?

Fahad Anwar says:

Thanks for the helpful video

Dickpuncher says:

i get some wierd characters in my cmd window when it outputs the values entered dunno why

Paul Alexander Hasfjord says:

Hi, I get some strange error message when I try to compile the file.
“warning: implicit decleration of function ‘gets’

What does this mean ?

Alba MK says:

I don’t understand why is he using puts() instead of printf(). Do they both have the same objective?

Harry Chan Nyein says:

I like to eat McStanky’s pussy

Great Adib says:

haha name is pussy loves to eat cumm!!! so funny man;

Niiles Punkari says:

my compiler did not allow this.

Why is the gets function so dangerous that it should not be used?
http://stackoverflow.com/questions/1694036/why-is-the-gets-function-so-dangerous-that-it-should-not-be-used

Wadah Taha says:

can we use gets for ‘int’ type variable ??

Stuart Reilly says:

Can you zoom in please? Thanks for educating us

Umer Tariq says:

why do we use number infront of chars??

DerSohnDesAlvaters says:

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

Write a comment

*

Human Verification: In order to verify that you are a human and not a spam bot, please enter the answer into the following box below based on the instructions contained in the graphic.


Do you like our videos?
Do you want to see more like that?

Please click below to support us on Facebook!

Send this to a friend

▷ Other ReviewsVehicles▷ Show Cars▷ Motorbikes▷ Scooters▷ Rims & Tires▷ Luxury BoatsFashion▷ Sunglasses▷ Luxury Watches▷ Luxury Purses▷ Jeans Wear▷ High Heels▷ Perfumes▷ Jewellery▷ Cosmetics▷ Shaving Helpers▷ Fashion HatsFooding▷ Chef Club▷ Fooding Helpers▷ Coktails & LiquorsSports▷ Sport Shoes▷ Fitness & Detox▷ Golf Gear▷ Racquets▷ Diving Equipment▷ Ski Gear▷ Snowboards▷ Surf Boards▷ Rollers & SkatesEntertainment▷ DIY Guides▷ Zik Instruments▷ Published Books▷ Music Albums▷ Cine Movies▷ Trading Helpers▷ Make Money▷ Fishing Equipment▷ Paintball Supplies▷ Trading Card Games▷ Telescopes▷ Knives▷ VapesHigh Tech▷ Flat Screens▷ Tech Devices▷ Camera Lenses▷ Printers▷ USB Devices▷ PC Hardware▷ Network Gear▷ Cloud Servers▷ Software Helpers▷ Programmer Helpers▷ Mobile Apps▷ Hearing AidsHome▷ Home Furniture▷ Home Appliances▷ Beddings▷ Floor Layings▷ Barbecues▷ Aquarium Gear▷ Safe Boxes▷ Office Supplies▷ Security Locks▷ Cleaning ProductsKids▷ Baby Strollers▷ Child Car Seats▷ Remote ControlledTravel▷ Luggages & Bags▷ Airlines Seats▷ Hotel Rooms▷ Fun Trips▷ Cruise Ships▷ Mexico Tours