- 2072 Kartik · 2 marks
Types of standard I/O in C
Short answer
Standard I/O includes console streams stdin, stdout, stderr; formatted I/O with printf/scanf; unformatted I/O: character getchar/putchar and string fgets/puts; and file I/O through functions like fprintf, fscanf, fread, fwrite.
List different types of standard I/O used in C.
C has the following kinds of standard input/output:
- Console (stream) I/O through the three standard streams:
stdin(keyboard, standard input),stdout(screen, standard output) andstderr(screen, standard error output). - Formatted I/O:
printf()andscanf()with format specifiers. - Unformatted I/O: character functions
getchar(),putchar(),getch(),getche(), and string functionsgets(),puts(). (getch()andgetche()come from<conio.h>and are not part of standard C;gets()is unsafe and was removed in C11, sofgets()is used instead.) - File I/O:
fprintf,fscanf,fgetc,fputc,fread,fwriteon files.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Standard penetration test and corrections · Foundation Engineering, chapter 2 · asked 3×
- Superheterodyne AM receiver; why standard AM in broadcasting · Communication Systems, chapter 2 · asked 2×