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?
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
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.
thanks for the help. and i wanted to ask if there is a function like 'getch' to use across the platform like linux
Thanks. What does it mean that 'getch' can be used as an macro?
I'm in C++ but you've helped me a lot! Thanks!
I should have learned all this 4 years ago! All those times i've been using scanf for character input lol.
These days it's sscanf and not scanf too.
You always save me, thanks!!!
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.
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?
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
that debug hack was the real reason i was here, thanks
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.
EOF is not a character and is defined as a signed int in most libraries which is different than the -1 signed char
@@CodeVault how can it get EOF when it always prompt you to enter a character?
@@phuongnguyen-sb5de I think it's usually CTRL + D or CTRL + Z (on Windows)
short video but i know everything
You are fabulous - no less!
Kbhit() and getch() alternatives for other os which not supports ?
I tried finding something but all alternatives, I think, are platform specific, unfortunately
@@CodeVault it also fine when found any platform specific alternatives
@@SidsAnalysis Here is one for Linux for example: stackoverflow.com/questions/7469139/what-is-the-equivalent-to-getch-getche-in-linux
Thanks a lot!
Thanks a lot❤
Thank you
thanks man
thanks!
Thanks
do i have to enter (stdin)??? if i don't... won't the getc func work??
Yes, you have to hit enter
👍
Why do you assign it as int??
It's what the function's signature returns to account for EOF
also helped me