getc, getch, getche and getchar in C

Sdílet
Vložit
  • čas přidán 16. 10. 2019
  • Check out our Discord server: / discord

Komentáře • 32

  • @vasusubbannavar5789
    @vasusubbannavar5789 Před 2 lety

    thanks for the help. and i wanted to ask if there is a function like 'getch' to use across the platform like linux

  • @artukiwi7088
    @artukiwi7088 Před 4 lety +1

    Thanks. What does it mean that 'getch' can be used as an macro?

  • @filiperubin
    @filiperubin Před 4 lety +3

    I'm in C++ but you've helped me a lot! Thanks!

  • @janmarcbaniqued7612
    @janmarcbaniqued7612 Před 3 lety +3

    I should have learned all this 4 years ago! All those times i've been using scanf for character input lol.

  • @matiasalzu3999
    @matiasalzu3999 Před 3 lety +1

    You always save me, thanks!!!

  • @user-su5sq5ib3i
    @user-su5sq5ib3i Před rokem

    Can you do a video on the EOF macros? I am stuck on a program in teh ansi c book and cant find valid info on it on youtube.

  • @indibarsarkar3936
    @indibarsarkar3936 Před 2 lety +1

    Thanks for this helpful video. I have a question. Are there any alternatives available if we need to take a single character input from the user without storing it in the buffer (ie. without the need to press the enter key) but also following the standard norms?

    • @CodeVault
      @CodeVault  Před 2 lety +2

      As far as I know it's not possible in a standard way. Here's a good answer on this topic: stackoverflow.com/questions/421860/capture-characters-from-standard-input-without-waiting-for-enter-to-be-pressed

  • @HK-sw3vi
    @HK-sw3vi Před 3 lety

    that debug hack was the real reason i was here, thanks

  • @jalalbounaim
    @jalalbounaim Před 2 lety +1

    why char cannot store -1?(i.e. EOF)
    signed char has from -128 to + 127. Enough for all the ascii codes and -1 as well.
    Thanks in advance, love ur videos and ur channel. A gem.

    • @CodeVault
      @CodeVault  Před 2 lety +3

      EOF is not a character and is defined as a signed int in most libraries which is different than the -1 signed char

    • @phuongnguyen-sb5de
      @phuongnguyen-sb5de Před 2 lety +1

      @@CodeVault how can it get EOF when it always prompt you to enter a character?

    • @CodeVault
      @CodeVault  Před 2 lety +2

      @@phuongnguyen-sb5de I think it's usually CTRL + D or CTRL + Z (on Windows)

  • @teachkhmerbinary
    @teachkhmerbinary Před měsícem

    short video but i know everything

  • @mortenlund1418
    @mortenlund1418 Před 2 lety

    You are fabulous - no less!

  • @SidsAnalysis
    @SidsAnalysis Před rokem

    Kbhit() and getch() alternatives for other os which not supports ?

    • @CodeVault
      @CodeVault  Před rokem +2

      I tried finding something but all alternatives, I think, are platform specific, unfortunately

    • @SidsAnalysis
      @SidsAnalysis Před rokem

      @@CodeVault it also fine when found any platform specific alternatives

    • @CodeVault
      @CodeVault  Před rokem +1

      @@SidsAnalysis Here is one for Linux for example: stackoverflow.com/questions/7469139/what-is-the-equivalent-to-getch-getche-in-linux

  • @eva42sh
    @eva42sh Před 2 lety

    Thanks a lot!

  • @hridyanshgautam9558
    @hridyanshgautam9558 Před 2 lety

    Thanks a lot❤

  • @thelolord702
    @thelolord702 Před 2 lety

    Thank you

  • @d.am1nn
    @d.am1nn Před 7 měsíci

    thanks man

  • @nhandang5105
    @nhandang5105 Před 3 lety

    thanks!

  • @otnielewu7777
    @otnielewu7777 Před 2 lety

    Thanks

  • @ZahinAbdullah
    @ZahinAbdullah Před rokem

    do i have to enter (stdin)??? if i don't... won't the getc func work??

  • @arvindersingh9863
    @arvindersingh9863 Před 4 lety

    👍

  • @jakubsz4602
    @jakubsz4602 Před rokem

    Why do you assign it as int??

    • @CodeVault
      @CodeVault  Před rokem

      It's what the function's signature returns to account for EOF

  • @zhyrgalbek5197
    @zhyrgalbek5197 Před 4 lety

    also helped me