C Programming! Input Functions and Buffers

preview_player
Показать описание
PIEAS (Pakistan Institute of Engineering and Applied Sciences)
Рекомендации по теме
Комментарии
Автор

as you said, no other tutorial has explained this much detail ... thanks bro

ayoubaidar
Автор

Thanks for this. There is no content on the internet explaining clearly why we need to clear the buffer.

coolbuddy
Автор

excellent
No one has given this much detailed explanation on youtube thankyou and please keep uploading videos

sainithyamsani
Автор

really best video on entire youtube for that topic

nrcofficialgaming
Автор

Nice Explanation Bro.. Support from India 🧡

soujatyabhattacharya
Автор

Thank you so much for this. The most helpful video I've seen on this concept so far on YouTube.

piratesfan
Автор

Thanks a lot for making this videos on topic is something like "attention to details" in learning.

hemantharadhya
Автор

In short...

Any input values are not stored directly into the ram or variable.
First, the input be placed in the buffer memory. From here, scanf function will read the data sequentially and then converts the char data into int type. After this only, the value is stored into the variable i.e. ram.

tnamen
Автор

u r really very gud teacher i salute u and plz dont stop your self to making videos and definatly one day u will be success on youtube

jugalgoswami
Автор

Great explanation.. keep doing videos on c

shambhugkrishnan
Автор

Thank you very much brother its really helpfull video. keep it up

punjabilog
Автор

Thanks a lot, I was got frustrated with the problem, but you solved it 😇

pranjalbankar
Автор

i wasted half an hour search this problem then i found your video and finally code run perfect

abhishekshah
Автор

such a great explanation!! Thank you so much

ahamd
Автор

i have no idea why u stopped posting videos but just wanna let u know that ur videos are amazing and I could not find any like them anywhere 🙂

amirwagih
Автор

You can use fflush(stdin), after printf which will clear buffer and can intake the character

arjunpudu
Автор

Thank you for the clean explaination. Why do you not use fflush(stdin) function instead of typng getchar() function twice?My instructor told me that it was not a safe function but he didn't dive into.Hence, I am not convinced by the answer. I would be happy if you can explain.

Best,

I would type:

int age;
char gender;

printf("Please enter your age: ");
scanf("%d", %age);

printf("Please type your gender: ");
fflush(stdin);
gender=getchar();
printf("Your age is %d and your gender is %c ", age, gender)

return 0;

marduktr
Автор

if after converting into age, the characters are removed, how and when is the data of buffer sent to stdin ?

harshraj_
visit shbcf.ru