getc, getch, getche and getchar in C

  Рет қаралды 35,616

CodeVault

CodeVault

Күн бұрын

Пікірлер: 34
@jmfb789
@jmfb789 4 жыл бұрын
I should have learned all this 4 years ago! All those times i've been using scanf for character input lol.
@paultidwell8799
@paultidwell8799 Жыл бұрын
These days it's sscanf and not scanf too.
@filiperubin
@filiperubin 4 жыл бұрын
I'm in C++ but you've helped me a lot! Thanks!
@vasusubbannavar5789
@vasusubbannavar5789 2 жыл бұрын
thanks for the help. and i wanted to ask if there is a function like 'getch' to use across the platform like linux
@HK-sw3vi
@HK-sw3vi 4 жыл бұрын
that debug hack was the real reason i was here, thanks
@jalalbounaim
@jalalbounaim 3 жыл бұрын
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 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 3 жыл бұрын
@@CodeVault how can it get EOF when it always prompt you to enter a character?
@CodeVault
@CodeVault 3 жыл бұрын
@@phuongnguyen-sb5de I think it's usually CTRL + D or CTRL + Z (on Windows)
@matiasalzu3999
@matiasalzu3999 3 жыл бұрын
You always save me, thanks!!!
@SidsAnalysis
@SidsAnalysis 2 жыл бұрын
Kbhit() and getch() alternatives for other os which not supports ?
@CodeVault
@CodeVault 2 жыл бұрын
I tried finding something but all alternatives, I think, are platform specific, unfortunately
@SidsAnalysis
@SidsAnalysis 2 жыл бұрын
@@CodeVault it also fine when found any platform specific alternatives
@CodeVault
@CodeVault 2 жыл бұрын
@@SidsAnalysis Here is one for Linux for example: stackoverflow.com/questions/7469139/what-is-the-equivalent-to-getch-getche-in-linux
@artukiwi7088
@artukiwi7088 4 жыл бұрын
Thanks. What does it mean that 'getch' can be used as an macro?
@indibarsarkar3936
@indibarsarkar3936 2 жыл бұрын
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 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
@mb59621
@mb59621 3 ай бұрын
Hey I hope you are doing well . I am on Linux and getch() does not work . I am writing a program that specifically works on the principle that the user enters the character but is not allowed to see the input he gives . How do I write my own getch() or do you know if there is a substitute for it in the std. c library?
@CodeVault
@CodeVault 3 ай бұрын
There are actually some good solutions here: stackoverflow.com/questions/3276546/how-to-implement-getch-function-of-c-in-linux
@teachkhmerbinary
@teachkhmerbinary 8 ай бұрын
short video but i know everything
@mortenlund1418
@mortenlund1418 3 жыл бұрын
You are fabulous - no less!
@user-su5sq5ib3i
@user-su5sq5ib3i Жыл бұрын
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.
@ZahinAbdullah
@ZahinAbdullah 2 жыл бұрын
do i have to enter (stdin)??? if i don't... won't the getc func work??
@CodeVault
@CodeVault 2 жыл бұрын
Yes, you have to hit enter
@d.am1nn
@d.am1nn Жыл бұрын
thanks man
@jakubsz4602
@jakubsz4602 2 жыл бұрын
Why do you assign it as int??
@CodeVault
@CodeVault 2 жыл бұрын
It's what the function's signature returns to account for EOF
@hridyanshgautam9558
@hridyanshgautam9558 3 жыл бұрын
Thanks a lot❤
@otnielewu7777
@otnielewu7777 2 жыл бұрын
Thanks
@eva42sh
@eva42sh 2 жыл бұрын
Thanks a lot!
@thelolord702
@thelolord702 3 жыл бұрын
Thank you
@nhandang5105
@nhandang5105 4 жыл бұрын
thanks!
@arvindersingh9863
@arvindersingh9863 5 жыл бұрын
👍
@zhyrgalbek5197
@zhyrgalbek5197 4 жыл бұрын
also helped me
putc, putch and putchar in C
5:44
CodeVault
Рет қаралды 7 М.
you will never ask about pointers again after watching this video
8:03
Hilarious FAKE TONGUE Prank by WEDNESDAY😏🖤
0:39
La La Life Shorts
Рет қаралды 44 МЛН
Function Pointers | C Programming Tutorial
18:31
Portfolio Courses
Рет қаралды 71 М.
C Programming! getchar() Function and Buffers
9:43
Minhaj Ansari
Рет қаралды 10 М.
Designing The Input Function using getchar()
9:56
Neso Academy
Рет қаралды 148 М.
C enums 📅
4:27
Bro Code
Рет қаралды 67 М.
Learn Any Programming Language In 3 Hours!
22:37
Code With Huw
Рет қаралды 632 М.
I run untested, viewer-submitted code on my 500-LED christmas tree.
45:17
String In Char Array VS. Pointer To String Literal | C Programming Tutorial
9:58
C_25 Unformatted Input Functions in C | C Programming Tutorials
14:19
Jenny's Lectures CS IT
Рет қаралды 261 М.