▶️ Use of fflush(stdin) in C || Skipping Problem of scanf() Function in C

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 ต.ค. 2024

ความคิดเห็น • 185

  • @PRITAMPAUL
    @PRITAMPAUL  3 ปีที่แล้ว +5

    telegram.im/CProgrammingByPritamPaul
    follow this telegram channel for more recent updates and discussions on C Programming and Problem Solving Through C

  • @harshitranjanrai7837
    @harshitranjanrai7837 2 ปีที่แล้ว +1

    This Video Lecture is so helpful for me.... Thanks a lot sir

  • @yashvardhanyadav6684
    @yashvardhanyadav6684 2 ปีที่แล้ว +10

    You can also use scanf("
    %c",ch) or scanf(" %c",ch) (space before %c) to remove buffer from the keyboard instead of fflush(stdin)

  • @NOPerative
    @NOPerative 2 ปีที่แล้ว

    Awesome.
    Quick & easy without any need for unorthodox tricks or hack work-arounds.
    Enjoyable.

  • @mohammedalazab5379
    @mohammedalazab5379 2 ปีที่แล้ว

    Thank you sir
    What about fflush(stdout) ? Does it have the same use such as fflush(stdin) or what is exactly the difference?

    • @redcrafterlppa303
      @redcrafterlppa303 2 ปีที่แล้ว +1

      Please don't use fflush on an instream like stdin. It's undefined behavior and is compiler specific. It is not part of the c++ standard to flush an instream.

    • @redcrafterlppa303
      @redcrafterlppa303 2 ปีที่แล้ว

      Flush stdout clears stuck characters that weren't printed after pushing them to the buffer. It is a legitimate use of fflush.

  • @abhijitpa1
    @abhijitpa1 ปีที่แล้ว +3

    Shouldn't it be mentioned that it is undefined behavior according to C standard if you use if for stdin. Also, it's not portable and compiler specific. Visual studio code allows this.

    • @GaryChike
      @GaryChike ปีที่แล้ว

      Yes, fflush(stdin) is undefined behavior. fflush is meant to be called on an output stream (i.e. fflush(stdout))

  • @jerichoguillermo8699
    @jerichoguillermo8699 9 หลายเดือนก่อน +1

    How about 'fflush(stdout)'?

  • @Compute_Pro
    @Compute_Pro ปีที่แล้ว

    Is in c++ also need to buffer flush when we working with cin (string) ?

  • @aswadinushur
    @aswadinushur 3 ปีที่แล้ว +2

    Thank you for this explanation sir👍

    • @PRITAMPAUL
      @PRITAMPAUL  3 ปีที่แล้ว

      most welcome
      please do visit other playlists also

    • @redcrafterlppa303
      @redcrafterlppa303 2 ปีที่แล้ว

      Please don't use fflush on an instream like stdin. It's undefined behavior and is compiler specific. It is not part of the c++ standard to flush an instream.

  • @deepjyotisinha1879
    @deepjyotisinha1879 3 ปีที่แล้ว

    Awesome video. Was in a problem for the last 3 hours. Crystal clear video. Thank you. Make more videos like this

    • @PRITAMPAUL
      @PRITAMPAUL  3 ปีที่แล้ว +1

      Glad it helped

  • @lokeshsurana5248
    @lokeshsurana5248 3 ปีที่แล้ว

    Sir my professor many times mention that use newline (whenever using printf) to flush buffer what is that exactly?
    Nice video 🥰

  • @shri_cow
    @shri_cow 3 ปีที่แล้ว

    Fflush cleans all the privous data from the buffer or just the input which is given before fflush(mean here fflush cleans only enter or 3 also)?

    • @PRITAMPAUL
      @PRITAMPAUL  3 ปีที่แล้ว

      only the enter.. the last input

  • @pujagorai9973
    @pujagorai9973 3 ปีที่แล้ว

    Thank you so much sir. It's very useful..and you have expalined it so well..😃😃😃

    • @PRITAMPAUL
      @PRITAMPAUL  3 ปีที่แล้ว

      You wellcome!
      do follow the other playlists! and subscribe the telegram channel too for more recent updates

  • @imrankhan_619
    @imrankhan_619 2 ปีที่แล้ว

    Tqs Sir your explained process is very good!😊

  • @sheetalkumari8581
    @sheetalkumari8581 3 ปีที่แล้ว

    Keep doing, nice explanation
    far better than those who just put the definition in video.

    • @PRITAMPAUL
      @PRITAMPAUL  3 ปีที่แล้ว

      Thanks a lot 😊

    • @redcrafterlppa303
      @redcrafterlppa303 2 ปีที่แล้ว

      Please don't use fflush on an instream like stdin. It's undefined behavior and is compiler specific. It is not part of the c++ standard to flush an instream.

  • @0001-exe
    @0001-exe 3 ปีที่แล้ว

    thank you so much! you explained it very well!!

    • @PRITAMPAUL
      @PRITAMPAUL  3 ปีที่แล้ว

      You wellcome!
      do follow the other playlists! and subscribe the telegram channel too for more recent updates

  • @mahadev1050
    @mahadev1050 4 ปีที่แล้ว +2

    Thank you sir.

    • @PRITAMPAUL
      @PRITAMPAUL  4 ปีที่แล้ว

      Most welcome

    • @PRITAMPAUL
      @PRITAMPAUL  4 ปีที่แล้ว

      Share these videos if you found them useful... your support would encourage me to make more videos

  • @SachinSingh-id8mf
    @SachinSingh-id8mf 3 ปีที่แล้ว

    Sir which IDE you were using in this video???

    • @PRITAMPAUL
      @PRITAMPAUL  3 ปีที่แล้ว

      DEV C++
      You can download this from net! in the following link you would find the way to download the IDE
      th-cam.com/video/jmvuIEhaKTs/w-d-xo.html

  • @amayaamarasinghe5838
    @amayaamarasinghe5838 ปีที่แล้ว

    Thank you! A great explanation.

  • @Hitesh-oz1dx
    @Hitesh-oz1dx 2 ปีที่แล้ว

    THANK YOU SO MUCH, Very helpful video

    • @redcrafterlppa303
      @redcrafterlppa303 2 ปีที่แล้ว

      Please don't use fflush on an instream like stdin. It's undefined behavior and is compiler specific. It is not part of the c++ standard to flush an instream.

  • @mainakmukherjee3444
    @mainakmukherjee3444 3 ปีที่แล้ว

    Hi sir...I got it...but can you explain me one thing??
    If I read a file using getc...is there still buffer ??
    Because I used fflush(stdin)when reading file's content via fgetc...fflush(stdin)is not working in this case...is the buffer used in fgetc... different with the buffer...which is used to store data which is coming from the external input device?
    Please say sir...this question is killing me

    • @emptyFull123
      @emptyFull123 3 ปีที่แล้ว

      Don't use fflush everywhere it's result is unpredictable...try to avoid using it...

    • @redcrafterlppa303
      @redcrafterlppa303 2 ปีที่แล้ว

      Please don't use fflush on an instream like stdin. It's undefined behavior and is compiler specific. It is not part of the c++ standard to flush an instream.

  • @lancer3077
    @lancer3077 ปีที่แล้ว

    Thanks

  • @joelle2592
    @joelle2592 3 ปีที่แล้ว

    First of all: you explained it very well thank you for that! I understood everything.
    but secondly: i have a problem. i tried it and did exactly this example that you did. But for me it didn't work :( i must have done something wrong but i cant find where the problem is
    this is what i typed in:
    #include
    #include
    int main(){
    int a;
    char ch;
    printf("
    Enter any integer:");
    scanf("%d", &a);
    fflush(stdin);
    printf("
    Enter any character:");
    scanf("%c", &ch);
    printf("
    The integer is: %d
    ", a);
    printf("The character is: %c
    ", ch);
    return 0;
    }
    Did I do something wrong?

    • @PRITAMPAUL
      @PRITAMPAUL  3 ปีที่แล้ว +1

      Hii.. first of all thanks for watching my video. And also thanks for comment.
      Can I get to know which OS and which compiler are you using?

    • @PRITAMPAUL
      @PRITAMPAUL  3 ปีที่แล้ว +1

      the code you have written here i have checked for it! and the code is showing the correct output.
      if you have telegram then text me there!
      @i_am_pritam_paul
      this is the ID
      ...

  • @aniruddhaporel3661
    @aniruddhaporel3661 3 ปีที่แล้ว

    Thank you very much.....it's helped me lot....

    • @PRITAMPAUL
      @PRITAMPAUL  3 ปีที่แล้ว +1

      my pleasure 🥰

    • @aniruddhaporel3661
      @aniruddhaporel3661 3 ปีที่แล้ว

      @@PRITAMPAUL can you give ur phone number?
      I have a question.......

  • @Knowledgeduniya1432
    @Knowledgeduniya1432 3 ปีที่แล้ว

    Sir while usingf fflush in ourn program why character is taking enter but int b is not taking enter

    • @PRITAMPAUL
      @PRITAMPAUL  3 ปีที่แล้ว

      due to the input buffer!

  • @RahulKumar-yy3dc
    @RahulKumar-yy3dc 3 ปีที่แล้ว +1

    small hack if you dont like fflush function use space in scanf after "
    scanf("%c",&a) //cause input stream problem
    scanf(" %c",&s) // space that you use is solve your buffer problem
    Because someone times fflush create a bug that will ruin days to find thet what wrong with my code

    • @PRITAMPAUL
      @PRITAMPAUL  3 ปีที่แล้ว

      space works. Thank you for that.
      i have not found fflush(stdin) creating any bug. so need to explore more...
      thanks for the comment bro

    • @jyoti3427
      @jyoti3427 3 ปีที่แล้ว

      @Rahul Kumar what if we are using gets function instead of scanf beacuse there we don't use %s
      And I have also tried to do using scanf instead of gets and also give a space after scanf
      But still I get the same problem
      Scanf(" %d", &b.bookid);
      Scan(" %s", &b.title)
      As you can see I have applied space in both scanf
      But still compiler not taking my string

  • @mardyyt7867
    @mardyyt7867 3 ปีที่แล้ว

    thank for video....its helpful

    • @PRITAMPAUL
      @PRITAMPAUL  3 ปีที่แล้ว

      You are most welcome...
      Please like the video and share with your friend and subscribe the channel for more

  • @ipsakarki4442
    @ipsakarki4442 3 ปีที่แล้ว +2

    Instead of using that method,
    We can simply write ,
    scanf(“ %c”,&ch);
    //space is given before %c

    • @emptyFull123
      @emptyFull123 3 ปีที่แล้ว +1

      What does it do? Can you elaborate it 🙄

    • @ipsakarki4442
      @ipsakarki4442 3 ปีที่แล้ว +1

      @@emptyFull123 we press the enter key after giving the first input if we do not place blank space before %c then, return character will be stored in the character variable ch.
      so, whitespace character is used to skip certain input.

    • @emptyFull123
      @emptyFull123 3 ปีที่แล้ว +1

      @@ipsakarki4442 does whitespace and enter means the same?

    • @naveenkanth2218
      @naveenkanth2218 3 ปีที่แล้ว +1

      Nice

    • @redcrafterlppa303
      @redcrafterlppa303 2 ปีที่แล้ว +1

      Please don't use fflush on an instream like stdin. It's undefined behavior and is compiler specific. It is not part of the c++ standard to flush an instream.
      Use the method explained here or "while(getc(stdin)! =/n) ;" instead

  • @maitenatali6689
    @maitenatali6689 2 ปีที่แล้ว

    excelent video! the best I've seen

    • @redcrafterlppa303
      @redcrafterlppa303 2 ปีที่แล้ว

      Please don't use fflush on an instream like stdin. It's undefined behavior and is compiler specific. It is not part of the c++ standard to flush an instream.

  • @neverwh3re
    @neverwh3re 4 ปีที่แล้ว

    thanks sir, well noted.

    • @PRITAMPAUL
      @PRITAMPAUL  4 ปีที่แล้ว

      u welcome.. if you found this useful please do like, share and subscribe the channel for more videos.

  • @prathameshlagad1588
    @prathameshlagad1588 2 ปีที่แล้ว

    Thanks exactly looking for this.

    • @redcrafterlppa303
      @redcrafterlppa303 2 ปีที่แล้ว

      Please don't use fflush on an instream like stdin. It's undefined behavior and is compiler specific. It is not part of the c++ standard to flush an instream.

  • @ANKITSINGH-nk9yi
    @ANKITSINGH-nk9yi 3 ปีที่แล้ว

    Great Work Brother

    • @PRITAMPAUL
      @PRITAMPAUL  3 ปีที่แล้ว

      thank u.... please visit other playlists also

  • @shaileshmorya3719
    @shaileshmorya3719 2 ปีที่แล้ว

    Thanks sir its my dout will be cleared

  • @ayashakumarimandal8681
    @ayashakumarimandal8681 3 ปีที่แล้ว

    Amazing sir.

    • @PRITAMPAUL
      @PRITAMPAUL  3 ปีที่แล้ว

      So nice of you
      Thank You

  • @Knowledgeduniya1432
    @Knowledgeduniya1432 3 ปีที่แล้ว

    Thank you Brother

  • @harshitbajaj7549
    @harshitbajaj7549 3 ปีที่แล้ว

    why it again take input for same character if we write "%c " in scanf
    "%c" pe it does not take input after pressing enter
    What is the role of space here??

    • @PRITAMPAUL
      @PRITAMPAUL  3 ปีที่แล้ว

      I didn't get your question. Please elaborate it again.
      Thank You

  • @codewithpritam2929
    @codewithpritam2929 2 ปีที่แล้ว

    it is very helpful video data

    • @redcrafterlppa303
      @redcrafterlppa303 2 ปีที่แล้ว

      Please don't use fflush on an instream like stdin. It's undefined behavior and is compiler specific. It is not part of the c++ standard to flush an instream.

  • @ChemiGirl817
    @ChemiGirl817 4 ปีที่แล้ว

    Well explained...

    • @PRITAMPAUL
      @PRITAMPAUL  4 ปีที่แล้ว

      Thank You.. Please Do subscribe for more videos in near future

  • @nvm9174
    @nvm9174 ปีที่แล้ว +1

    OKAY :)

  • @swetasenpaul6709
    @swetasenpaul6709 4 ปีที่แล้ว

    #PritamPaul
    #prp
    #CProgrammingbyPritamPaul

  • @jyotidangal4060
    @jyotidangal4060 3 ปีที่แล้ว

    Well explanation sir

    • @PRITAMPAUL
      @PRITAMPAUL  3 ปีที่แล้ว

      thank u
      please do subscribe to support the channel & visit other playlists as well

    • @redcrafterlppa303
      @redcrafterlppa303 2 ปีที่แล้ว

      Please don't use fflush on an instream like stdin. It's undefined behavior and is compiler specific. It is not part of the c++ standard to flush an instream.

  • @pemindurayan3121
    @pemindurayan3121 4 ปีที่แล้ว

    Thank you very much...

    • @PRITAMPAUL
      @PRITAMPAUL  4 ปีที่แล้ว

      You're most welcome

  • @vineetkumartiwary2241
    @vineetkumartiwary2241 3 ปีที่แล้ว

    Sir what is buffer please explain it

    • @PRITAMPAUL
      @PRITAMPAUL  3 ปีที่แล้ว

      Sure later in any video i will disscuss

    • @redcrafterlppa303
      @redcrafterlppa303 2 ปีที่แล้ว

      Please don't use fflush on an instream like stdin. It's undefined behavior and is compiler specific. It is not part of the c++ standard to flush an instream.

    • @redcrafterlppa303
      @redcrafterlppa303 2 ปีที่แล้ว

      A buffer in general is an intermediate storage for something. In this case for characters coming from the input you typed in.

  • @usmanaziz2924
    @usmanaziz2924 3 ปีที่แล้ว

    Fflush(stdin) is use in c++ or not??

    • @PRITAMPAUL
      @PRITAMPAUL  3 ปีที่แล้ว

      yes! you can use it.
      please go through the link for more detailed explanation
      www.programiz.com/cpp-programming/library-function/cstdio/fflush

  • @akminator130
    @akminator130 ปีที่แล้ว +1

    do not use fflush(stdin) as it has an undefined behavior in ISO C, POSIX ....

  • @nimeshsingh6229
    @nimeshsingh6229 3 ปีที่แล้ว

    Thnks sir

    • @PRITAMPAUL
      @PRITAMPAUL  3 ปีที่แล้ว

      Welcome
      please do like, share and subscribe for more
      and check other playlists also

  • @ranasarkar4825
    @ranasarkar4825 3 ปีที่แล้ว

    Thank you

  • @Engineering_Unlocked
    @Engineering_Unlocked 2 ปีที่แล้ว

    What's this at one time you says that enter is also a character, if it is!! than why at first time it shows character

    • @PRITAMPAUL
      @PRITAMPAUL  2 ปีที่แล้ว

      Didn't get your question! Please do elaborate again. Thank You

    • @redcrafterlppa303
      @redcrafterlppa303 2 ปีที่แล้ว +1

      Please don't use fflush on an instream like stdin. It's undefined behavior and is compiler specific. It is not part of the c++ standard to flush an instream.

    • @redcrafterlppa303
      @redcrafterlppa303 2 ปีที่แล้ว

      Because the first time it grabbed the first character in stdin but left the
      from the enter key in stdin. After" scanf.. " you should always write" while(getc(stdin)! =
      ) ;" to clear stdin.

  • @omkarkulkarni9250
    @omkarkulkarni9250 4 ปีที่แล้ว

    thank you...........................

    • @PRITAMPAUL
      @PRITAMPAUL  3 ปีที่แล้ว

      You are most welcome...
      Please like the video and share with your friend and subscribe the channel for more..
      please do check other playlists also

  • @sureshbhat9059
    @sureshbhat9059 2 ปีที่แล้ว +1

    What is stdin you wrote

    • @AshutoshKumar-nq1mp
      @AshutoshKumar-nq1mp 2 ปีที่แล้ว

      Standard input device

    • @redcrafterlppa303
      @redcrafterlppa303 2 ปีที่แล้ว

      Please don't use fflush on an instream like stdin. It's undefined behavior and is compiler specific. It is not part of the c++ standard to flush an instream.

  • @knownlearner568
    @knownlearner568 3 ปีที่แล้ว

    Thankyou brother

    • @redcrafterlppa303
      @redcrafterlppa303 2 ปีที่แล้ว

      Please don't use fflush on an instream like stdin. It's undefined behavior and is compiler specific. It is not part of the c++ standard to flush an instream.

  • @antoniofinocchiaro7903
    @antoniofinocchiaro7903 2 ปีที่แล้ว +3

    thanks okay?

  • @gabrielfernandez17
    @gabrielfernandez17 2 ปีที่แล้ว

    Thanks a lot bro.

    • @redcrafterlppa303
      @redcrafterlppa303 2 ปีที่แล้ว

      Please don't use fflush on an instream like stdin. It's undefined behavior and is compiler specific. It is not part of the c++ standard to flush an instream.

  • @048_mahabubmohammodshakil4
    @048_mahabubmohammodshakil4 3 ปีที่แล้ว

    Ok

  • @abdullahakyuz3710
    @abdullahakyuz3710 2 ปีที่แล้ว

    thanks brother.

    • @redcrafterlppa303
      @redcrafterlppa303 2 ปีที่แล้ว

      Please don't use fflush on an instream like stdin. It's undefined behavior and is compiler specific. It is not part of the c++ standard to flush an instream.

  • @harshnayak3243
    @harshnayak3243 2 ปีที่แล้ว

    thank you so much buddy

    • @redcrafterlppa303
      @redcrafterlppa303 2 ปีที่แล้ว

      Please don't use fflush on an instream like stdin. It's undefined behavior and is compiler specific. It is not part of the c++ standard to flush an instream.

  • @preetamackermann3038
    @preetamackermann3038 3 ปีที่แล้ว

    Thanks man 🙏

    • @PRITAMPAUL
      @PRITAMPAUL  3 ปีที่แล้ว

      Happy to help

    • @redcrafterlppa303
      @redcrafterlppa303 2 ปีที่แล้ว

      Please don't use fflush on an instream like stdin. It's undefined behavior and is compiler specific. It is not part of the c++ standard to flush an instream.

  • @hervinurr4094
    @hervinurr4094 3 ปีที่แล้ว

    Nice videoo

    • @PRITAMPAUL
      @PRITAMPAUL  3 ปีที่แล้ว

      You are most welcome...
      Please like the video and share with your friend and subscribe the channel for more..
      please do check other playlist also

  • @anandprajapati6700
    @anandprajapati6700 2 ปีที่แล้ว

    Is fpurge same?

    • @redcrafterlppa303
      @redcrafterlppa303 2 ปีที่แล้ว

      Please don't use fflush on an instream like stdin. It's undefined behavior and is compiler specific. It is not part of the c++ standard to flush an instream.

    • @redcrafterlppa303
      @redcrafterlppa303 2 ปีที่แล้ว

      Fpurge seems like it's actually designed to clear an instream. But if you want to be sure use "while(getc(stdin)! =
      ) ;"

  • @karthikeyanr4401
    @karthikeyanr4401 3 ปีที่แล้ว +1

    Thank You so much, that was a clean explanation :-)),

    • @PRITAMPAUL
      @PRITAMPAUL  3 ปีที่แล้ว

      Welcome bro.. Please do support the channel .... so that i could make many more videos.... and please let me know if there is any doubt so i would try to make a video on that issue

  • @shaileshmorya3719
    @shaileshmorya3719 2 ปีที่แล้ว

    Sir please explain digramticaly

  • @gurkanyildirim3822
    @gurkanyildirim3822 ปีที่แล้ว +2

    Ohmaygad

    • @Ghislo
      @Ghislo ปีที่แล้ว

      💀💀💀

  • @purubhargava8096
    @purubhargava8096 3 ปีที่แล้ว

    bhaiya thanku

    • @PRITAMPAUL
      @PRITAMPAUL  3 ปีที่แล้ว

      Welcome bro.. Please do support the channel .... so that i could make many more videos.... and please let me know if there is any doubt so i would try to make a video on that issue

  • @mainakmukherjee3444
    @mainakmukherjee3444 3 ปีที่แล้ว

    what is fflush(stdout)

    • @redcrafterlppa303
      @redcrafterlppa303 2 ปีที่แล้ว

      Please don't use fflush on an instream like stdin. It's undefined behavior and is compiler specific. It is not part of the c++ standard to flush an instream.

    • @redcrafterlppa303
      @redcrafterlppa303 2 ปีที่แล้ว

      Undefined behavior.

  • @gitapatwal260
    @gitapatwal260 2 ปีที่แล้ว +1

    I have a doubt that why this problem of buffer doesn't happen in integer or float

    • @redcrafterlppa303
      @redcrafterlppa303 2 ปีที่แล้ว

      Please don't use fflush on an instream like stdin. It's undefined behavior and is compiler specific. It is not part of the c++ standard to flush an instream.

    • @redcrafterlppa303
      @redcrafterlppa303 2 ปีที่แล้ว

      Because the "
      " from pressing enter after the int stays stored in stdin and when you call scanf on a not empty instream the contents is returned instead of asking for user input. Scanf was not designed for user input.

    • @danielhall6888
      @danielhall6888 2 ปีที่แล้ว

      @@redcrafterlppa303 What was the original purpose behind scanf?

    • @redcrafterlppa303
      @redcrafterlppa303 2 ปีที่แล้ว

      @@danielhall6888 it's an old c function to interpret the stdin buffer. And it's just that a way to interpret stdin. It can be used to read input from the user. But it has some bad side effects of how it works internally.

    • @drenephorian5943
      @drenephorian5943 2 ปีที่แล้ว

      @@redcrafterlppa303 but I believe he is talking about C not C++?

  • @Rahul-zo2rz
    @Rahul-zo2rz 3 ปีที่แล้ว

    doubt sir. Why doesn't 3 "input number" get cleaned from the inputs? What all characters will get cleaned except "ENTER", that is some other examples.

    • @PRITAMPAUL
      @PRITAMPAUL  3 ปีที่แล้ว +1

      I didn't get your Question! Please tell me elaborately
      You Can text me on Telegram @i_am_pritam_paul

    • @Rahul-zo2rz
      @Rahul-zo2rz 3 ปีที่แล้ว +1

      @@PRITAMPAUL I texted you
      on telegram

    • @PRITAMPAUL
      @PRITAMPAUL  3 ปีที่แล้ว

      @@Rahul-zo2rz replied you also

  • @atulyakharotia311
    @atulyakharotia311 2 ปีที่แล้ว +2

    Thx brother this was troubling me for two days

    • @redcrafterlppa303
      @redcrafterlppa303 2 ปีที่แล้ว

      Please don't use fflush on an instream like stdin. It's undefined behavior and is compiler specific. It is not part of the c++ standard to flush an instream.

  • @AyushKumar-tt4zh
    @AyushKumar-tt4zh 3 ปีที่แล้ว

    if you use the getchar function you will see the same thing.

    • @PRITAMPAUL
      @PRITAMPAUL  3 ปีที่แล้ว

      getchar() is used to hold the output screen untill you press any character in keyboard!

  • @ulro_
    @ulro_ 3 ปีที่แล้ว

    Why it still crashes here
    #include
    #include
    void cargarid(){
    int f;
    int numclientes;
    printf("Cuantos clientes deseas agregar : ");
    scanf( "%d", &numclientes );
    fflush(stdin);
    for(f=0;f

    • @samhita2917
      @samhita2917 3 ปีที่แล้ว

      Which one is crashed?

  • @anonymousvevo8697
    @anonymousvevo8697 3 ปีที่แล้ว +1

    dude your voice , is causing me a headache

    • @PRITAMPAUL
      @PRITAMPAUL  3 ปีที่แล้ว

      sry at that time my audio system was not so good! in recent videos i hope you won't face this kind of issue

  • @vinothr9445
    @vinothr9445 3 ปีที่แล้ว

    Amazing explanation 🔥

    • @PRITAMPAUL
      @PRITAMPAUL  3 ปีที่แล้ว

      Thank you 🙌
      please do support the channel so that i could make many more videos like this

  • @hitheshj9511
    @hitheshj9511 3 ปีที่แล้ว

    it still skips for me!

    • @PRITAMPAUL
      @PRITAMPAUL  3 ปีที่แล้ว +1

      send me your code in telegram
      @i_am_pritam_paul

  • @jcwarain789
    @jcwarain789 3 ปีที่แล้ว

    Thanks for this video.

    • @PRITAMPAUL
      @PRITAMPAUL  3 ปีที่แล้ว

      You are most welcome...
      Please like the video and share with your friend and subscribe the channel for more..
      please do check other playlists also

  • @TheTechIslandChannel
    @TheTechIslandChannel 3 ปีที่แล้ว

    Awesome explanation.

    • @PRITAMPAUL
      @PRITAMPAUL  3 ปีที่แล้ว

      Thanks

    • @PRITAMPAUL
      @PRITAMPAUL  3 ปีที่แล้ว +1

      please do subscribe and support the channel

    • @redcrafterlppa303
      @redcrafterlppa303 2 ปีที่แล้ว

      Please don't use fflush on an instream like stdin. It's undefined behavior and is compiler specific. It is not part of the c++ standard to flush an instream.

  • @Naman_Bansal102
    @Naman_Bansal102 ปีที่แล้ว

    hindi bol le ise badiya toh

    • @ankursinger102
      @ankursinger102 หลายเดือนก่อน

      🤣🤣🤣🤣

    • @PRITAMPAUL
      @PRITAMPAUL  หลายเดือนก่อน

      Yeah at that time my english was too bad. I was practicing and now after all the time I don’t think it is that much bad!! But thanks for the comment.
      And those who are laughing on this are the most stupid and negative people ever any creator can have.
      They come here to judge on english or to get some knowledge i dont know.

  • @ishanagarwal475
    @ishanagarwal475 3 ปีที่แล้ว

    You should never use fflush(stdin) ever the behaviour is undefined. But the problem presented does have other solutions

    • @PRITAMPAUL
      @PRITAMPAUL  3 ปีที่แล้ว +1

      1. I have shown where fflush(stdin) could be used! have not discussed either it should be used or not.
      2. ya it has other solutions too

    • @PRITAMPAUL
      @PRITAMPAUL  3 ปีที่แล้ว +1

      bdw thanks for commenting! really helpful and motivating

    • @ishanagarwal475
      @ishanagarwal475 3 ปีที่แล้ว

      @@PRITAMPAUL your welcome.

    • @gautamchaudhary3325
      @gautamchaudhary3325 3 ปีที่แล้ว

      @@PRITAMPAUL Sir in a book, i saw that it has used a loop to clear the flush..it was done like this
      int dh;
      while((dh = getchar()) != '
      ')
      ;
      this was stated as an alternative to fflush(stdin)...but i can't get it...can you please explain it

    • @PRITAMPAUL
      @PRITAMPAUL  3 ปีที่แล้ว

      @@gautamchaudhary3325 it means that the while loop will be going on until you press enter in your keyboard

  • @arghadeepmisra7865
    @arghadeepmisra7865 3 ปีที่แล้ว

    Hindi mein bol lete vai

    • @PRITAMPAUL
      @PRITAMPAUL  3 ปีที่แล้ว

      😅 I have more proficiency in English than Hindi. I am not from hindi medium brother. I am a bengali guy

    • @arghadeepmisra7865
      @arghadeepmisra7865 3 ปีที่แล้ว

      @@PRITAMPAUL বুঝলাম, ঠিক আছে same আমারও

  • @pradhanan9413
    @pradhanan9413 3 ปีที่แล้ว +1

    Thank you sir

  • @yogeshmishra1726
    @yogeshmishra1726 3 ปีที่แล้ว

    Nice explanation

    • @PRITAMPAUL
      @PRITAMPAUL  3 ปีที่แล้ว

      thanks brother.
      Please do subscribe and do support the channel ... and please do visit other playlists also

    • @redcrafterlppa303
      @redcrafterlppa303 2 ปีที่แล้ว

      Please don't use fflush on an instream like stdin. It's undefined behavior and is compiler specific. It is not part of the c++ standard to flush an instream.

  • @tarakkhurana1763
    @tarakkhurana1763 2 ปีที่แล้ว

    thank you

    • @redcrafterlppa303
      @redcrafterlppa303 2 ปีที่แล้ว

      Please don't use fflush on an instream like stdin. It's undefined behavior and is compiler specific. It is not part of the c++ standard to flush an instream.

    • @drenephorian5943
      @drenephorian5943 2 ปีที่แล้ว

      @@redcrafterlppa303 scanf("
      %c",ch) so this is more advisable?