CONSOLE INPUT/OUTPUT IN C LANGUAGE

CONSOLE INPUT/OUTPUT IN C LANGUAGE

In this article we’ll study about CONSOLE INPUT/OUTPUT IN C LANGUAGE. c simply has no provision. For receiving data from any of input device. And then for sending data to output device. Then how do we manage I/O?. and also how it is we were able to use printf() and scanf(). If c has nothing to offer for I/O? . This is what we intend to explore in this article of CONSOLE INPUT/OUTPUT IN C LANGUAGE.

TYPES OF INPUT/OUTPUT IN C :

Though c has no provision for I/O. It, of course , has to deal with at some point or other .Also There is not much use of writing a program. That spends all its time telling itself a secret. Each operating has its own facility. For inputting and outputting data from . And to the files and devices. It’s a simple matter for a system programmer to write a few small programs that would link the c compiler . For a particular operating system ‘s I/O facilities.

The developers of c compilers do just that . They write several standard I/O functions. And put them in libraries . These libraries are available with all c compilers . Whichever compiler you are using. Its almost certain that you have access to a library of I/o functions.

The way one OS displays output on the screen may be different than the way another OS does it. For example , The standard library function printf() for DOS based c compiler. Also Has been written keeping in mind the way DOS outputs character to screen. Similarly, the printf() function for a unix-based compiler has been written in mind the way. Unix output characters to screen. Then We should just have to use printf() and it would take care of the rest of the details. That are also OS dependent. Same is true about all other standard library functions available for OS

Furthermore ,There are numerous library functions available for I/O. These can be classified into two broad categories:

  1. Console I/O functions- functions to receive input from keyboard . And write write output to VDU.
  2. File I/o functions- Functions to perform I/O operations on a floppy disk or hard disk

for arrays click here.