Advanced input - output routines, C/C++ Programming

Assignment Help:

  Although we can handle most I/O routines with getc and putc , there are file versions of fgets, fputs, fprintf and fscanf . The syntax is
 
    fgets(stringname,n,filename);
 
This reads n-1 characters form the filename into the stringname variable 
  
    fputs(stringname,filename);
 
This writes the contents of the stringname to the filename channel
 
    fscanf(filename,"format",&variables);
 
This is identical to scanf except that the data is read from the filename
 
    fprintf(filename,"format",variables);
 
This is a file write function to store raw binary data
    fwrite(filename,"format",variables);
 
This is a file read function to read raw binary data
 
    fread(filename,"format",variables);

These I/O functions are actually the original I/O functions and printf etc are a simplified sub set of I/O. The VDU and keyboard defined as  streams namely stdout and stdin. Therefore within C we have re-defined the following function i.e

    fprintf(stdout,"format",variables);
 
to
 
    printf("format",variables);
 
Likewise we have 
 
  scanf subset of fscanf    File is stdin
  getchar subset of getc    File is stdin
  putchar subset of putc    File is  stdout
  puts subset of fputs      File is stdout
  gets subset of fgets      File is stdin


Related Discussions:- Advanced input - output routines

Example of pointers, #include "stdafx.h" #include iostream using name...

#include "stdafx.h" #include iostream using namespace std; int _tmain(int argc, _TCHAR* argv[]) {             int NumbHold[5];             int * ptrNumb;

What are control structures, What are control structures? - Control str...

What are control structures? - Control structures decide which instructions in program must be executed. - This implies that program flow may not necessarily move from one s

Object tracking project, Identify 2 to 3 existing algorithms commonly used ...

Identify 2 to 3 existing algorithms commonly used for object tracking. Algorithms should be in C or written in MATLAB language. Document these algorithms in flowcharts and run thes

Constructor, Why copy constructor accepts reference to an object and not t...

Why copy constructor accepts reference to an object and not the object itself, whether ah hence it we do otherwise

Copy constructor and overloaded assignment operator, please provide me the ...

please provide me the assignment help. What is the difference between a copy constructor and an overloaded assignment operator?

What is a union how does it differ from a structure, Question : (a) (i)...

Question : (a) (i) What is a structure member in C? What is the relationship between a structure member and the structure? (ii) How can structure variables be declared in C?

Write a program to illustrate array, Write a Program to illustrate Array? ...

Write a Program to illustrate Array? int x[100]; char text[80]; float temp[30]; static int marks[5]; We are able to use symbolic constants instead of expression. The valu

#title., A student apears in exam of math, physics, and chemistry. Write a...

A student apears in exam of math, physics, and chemistry. Write a program to find the total marks aa student has aqueired find the average.

Create a custom calculator program, //Create a custom calculator program ca...

//Create a custom calculator program capable of reading the input stream of an expression //and make basic computations to provide answer. //Your program will ask the user to

Loop, Write a program that writes your name on the monitor ten times. Write...

Write a program that writes your name on the monitor ten times. Write this program three times, once with each looping method.

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd