How To Clear The Input Buffer | C++ Tutorial

  Рет қаралды 26,141

Portfolio Courses

Portfolio Courses

Күн бұрын

Пікірлер: 56
@amkhrjee
@amkhrjee 2 жыл бұрын
I love how you make each and every video stand on its own feet, in the sense that the viewer has to never refer to a previous video to get hold of the topic being taught. Thank you for going the extra mile making each tutorial self-reliant!
@PortfolioCourses
@PortfolioCourses 2 жыл бұрын
You're welcome Aniruddha! :-) And thank you for the kind feedback.
@mohamedtalal4468
@mohamedtalal4468 10 ай бұрын
Thank you so much, I love how you convert the science from a thing we should memorize to a thing we could understand so we can deal with in many cases thank you
@emreibrahim8504
@emreibrahim8504 Жыл бұрын
The only person on youtube who explained this correctly
@PortfolioCourses
@PortfolioCourses Жыл бұрын
I'm glad you enjoyed the explanation Emre! :-)
@emreibrahim8504
@emreibrahim8504 Жыл бұрын
@@PortfolioCourses I loved it ♥
@PortfolioCourses
@PortfolioCourses Жыл бұрын
@@emreibrahim8504 Awesome ♥
@OOGWAYnewcp
@OOGWAYnewcp 6 ай бұрын
the comments already express what I want to say, thank you for this!
@PortfolioCourses
@PortfolioCourses 6 ай бұрын
You're very welcome! :-D
@tanmaygoyal8150
@tanmaygoyal8150 2 жыл бұрын
Thanks for this. On point, intelligent explanation.
@PortfolioCourses
@PortfolioCourses 2 жыл бұрын
You’re welcome Tanmay! :-)
@alizeeshan7447
@alizeeshan7447 Жыл бұрын
Ma Sha Allah... Wonderful explanation... 💌💌💌
@leonardopantoja7121
@leonardopantoja7121 9 ай бұрын
Dios mío! esto es poesía pura. GRACIAS.
@paoloose
@paoloose 2 жыл бұрын
Nice, clear and concise explanation
@PortfolioCourses
@PortfolioCourses 2 жыл бұрын
Thank you for the positive feedback Paolo, I’m glad that you enjoyed the video! :-)
@saidrafili262
@saidrafili262 2 жыл бұрын
Awesome explanation as usual. Thank you, Sir. Please, make more videos on interesting topics in C++
@PortfolioCourses
@PortfolioCourses 2 жыл бұрын
You're welcome Said, I'm glad you enjoyed it! :-) I am thinking about making some C++ videos on exceptions, design patterns, and data structures sometime soon.
@saidrafili262
@saidrafili262 2 жыл бұрын
@@PortfolioCoursesThat would be great, Sir. Thank you a lot!
@PortfolioCourses
@PortfolioCourses 2 жыл бұрын
@@saidrafili262 🙂
@MarkNabeel33
@MarkNabeel33 Жыл бұрын
That's really so useful, thank you !
@yuwownly8630
@yuwownly8630 2 жыл бұрын
Great video Sir. Your channel really helps me a lot in learning programming especially c++. But I have one question sir. Do you have any resources on how I can deeply understand buffers in c++ and how it works?
@PortfolioCourses
@PortfolioCourses 2 жыл бұрын
Thank you Yuw! :-) And sorry I don't have any resources on buffers in C++. The Google results aren't that great either it looks like: www.google.com/search?q=buffers+in+C%2B%2B. Maybe I can make more videos on this topic one day. Is there anything in particular you are trying to learn about buffers in C++?
@yuwownly8630
@yuwownly8630 2 жыл бұрын
@@PortfolioCourses Well, I just read about the stream buffer class. Maybe you could explain how it works and how we can use this class in our program. 😊
@PortfolioCourses
@PortfolioCourses 2 жыл бұрын
@@yuwownly8630 OK cool, I'll add that to my list of video ideas. 🙂
@yuwownly8630
@yuwownly8630 2 жыл бұрын
@@PortfolioCourses Thank you very much. It would be of great help.
@AMINE-dd1qy
@AMINE-dd1qy Жыл бұрын
thank you ! i finished the program and the get line function worked only for one time and i thought i had to start all over again but hey it is all that buffer thing ,so all i have to do is the ignore function just befor the get line to ensure that the buffer is empty right?
@Pesquisando0b1011
@Pesquisando0b1011 7 ай бұрын
You forget to mention to add the library .
@neo78344
@neo78344 11 ай бұрын
Great explanation.
@tushikushi93
@tushikushi93 Жыл бұрын
Superb explanation
@PortfolioCourses
@PortfolioCourses Жыл бұрын
I’m glad you enjoyed it Tushi! :-)
@brazamorim5239
@brazamorim5239 2 жыл бұрын
Nice explanation!
@PortfolioCourses
@PortfolioCourses 2 жыл бұрын
Thank you Braz, I'm glad you enjoyed it! :-)
@emreozbek6770
@emreozbek6770 Жыл бұрын
You can do this with string but not with char or int. char msg; cin>>msg; cout
@firepower01
@firepower01 Жыл бұрын
C and C++ legend over here
@PortfolioCourses
@PortfolioCourses Жыл бұрын
Thank you for the support! :-)
@alonsoperez9488
@alonsoperez9488 Жыл бұрын
Hello!!! Nice video sir explainning a difficult concept like clear the buffer, but I have a qusetion, I'm using Netbeans for windows, and when I use the cin.ignore(1,' '), my program can delete 1 skip even if I just put 1 for ignore the ' '. I whant to know if thi is because we areusing differents IDE's or it's because something else.
@lf6190
@lf6190 2 жыл бұрын
There is another solution that's a bit easier. You can do the following instead: number = _getch(); include the library. But thanks for the info. I didn't know you could this it like this too.
@PortfolioCourses
@PortfolioCourses 2 жыл бұрын
Thanks for sharing! I'm not sure that _getch() will clear the input buffer though. My understanding is that _getch() is a Microsoft function and not part of the C++ standard, so it will not be portable to other compilers. And _getch() will only clear one character from the input buffer, not clear the entire buffer. As a practical matter I can see how it would be useful to clear something like a newline character from the buffer, if you're expecting one newline character to be there.
@hafizsakib2734
@hafizsakib2734 2 жыл бұрын
Nice explanation
@PortfolioCourses
@PortfolioCourses 2 жыл бұрын
Thank you Hafiz! :-)
@kunalbahirat7795
@kunalbahirat7795 2 жыл бұрын
Thanks it was helpful!
@PortfolioCourses
@PortfolioCourses 2 жыл бұрын
I'm glad to hear it was helpful Kunal, and you're welcome! :-D
@xinking2644
@xinking2644 2 жыл бұрын
good explain! thank you
@PortfolioCourses
@PortfolioCourses 2 жыл бұрын
You're welcome Xin! 😀
@yamaikaguyachi
@yamaikaguyachi 2 жыл бұрын
Thanks again👌
@PortfolioCourses
@PortfolioCourses 2 жыл бұрын
You’re welcome! :-)
@yt-1161
@yt-1161 11 ай бұрын
aren't 2 characters ?
@PortfolioCourses
@PortfolioCourses 11 ай бұрын
is a newline, it's a special character that means "newline on the terminal/file/etc" so it's represented with in strings even though technically it's one character in practice (say, in a text file)
@contentofAI
@contentofAI 2 жыл бұрын
thank you sir
@PortfolioCourses
@PortfolioCourses 2 жыл бұрын
You’re welcome Lovish! :-)
@zoxemo3838
@zoxemo3838 2 жыл бұрын
👍👍👍
@emreozbek6770
@emreozbek6770 Жыл бұрын
What happens when you leave the parenthesis empty? cin.ignore();
@daugauga
@daugauga 9 ай бұрын
Im wondering about this too
@WhereToClick
@WhereToClick 4 ай бұрын
Thank you!
Convert A User-Defined Class Type To A Primitive Type | C++ Tutorial
5:02
Portfolio Courses
Рет қаралды 2,7 М.
How To Clear The Input Buffer | C Programming Tutorial
8:02
Portfolio Courses
Рет қаралды 21 М.
Каха и дочка
00:28
К-Media
Рет қаралды 3,4 МЛН
Cat mode and a glass of water #family #humor #fun
00:22
Kotiki_Z
Рет қаралды 42 МЛН
Что-что Мурсдей говорит? 💭 #симбочка #симба #мурсдей
00:19
C++  Tutorial: Mixing cin and getline // (and how to fix it)
13:44
Professor Hank Stalica
Рет қаралды 9 М.
you will never ask about pointers again after watching this video
8:03
Learn Any Programming Language In 3 Hours!
22:37
Code With Huw
Рет қаралды 639 М.
how Google writes gorgeous C++
7:40
Low Level
Рет қаралды 996 М.
cin.get, cin.putback, and cin.peek()
7:55
Robert Martin
Рет қаралды 38 М.
Define A Copy Constructor To Create A Deep Copy Of An Object | C++ Tutorial
17:06
Master Pointers in C:  10X Your C Coding!
14:12
Dave's Garage
Рет қаралды 344 М.
Abstract Classes And Pure Virtual Functions | C++ Tutorial
11:05
Portfolio Courses
Рет қаралды 17 М.
Infinite Input Buffer | C Programming Example
13:08
Portfolio Courses
Рет қаралды 17 М.
Chap4 cin.get(str) and cin.ignore(num, value)
5:29
Donna Gavin
Рет қаралды 721
Каха и дочка
00:28
К-Media
Рет қаралды 3,4 МЛН