C Programming

   »   

Computer Education, Training & Tutorial Resources - ComputerEducationWorld.com
Home » Free Educations » Free Programming Training » C Programming »

The printf functions provide formatted output conversion.

   int fprintf(FILE *stream, const char *format, …)
fprintf converts and writes output to stream under the control of format. The return value is the number of characters written, or negative if an error occurred.
The format string contains two types of objects: ordinary characters, which are copied to the output stream, and conversion specifications, each of which causes conversion and printing of the next successive argument to fprintf. Each conversion specification begins with the character % and ends with a conversion character. Between the % and the conversion character there may be, in order: (more…)


• • •
 

The scanf function deals with formatted input conversion.

int fscanf(FILE *stream, const char *format, …)
fscanf reads from stream under control of format, and assigns converted values through subsequent arguments, each of which must be a pointer. It returns when format is exhausted. fscanf returns EOF if end of file or an error occurs before any conversion; otherwise it returns the number of input items converted and assigned. (more…)


• • •
 

int fgetc(FILE *stream)
fgetc returns the next character of stream as an unsigned char (converted to an int), or EOF if end of file or error occurs.
char *fgets(char *s, int n, FILE *stream)
fgets reads at most the next n-1 characters into the array s, stopping if a newline is encountered; the newline is included in the array, which is terminated by ‘\0′. fgets returns s, or NULL if end of file or error occurs. (more…)


• • •
 

size_t fread(void *ptr, size_t size, size_t nobj, FILE *stream)
fread reads from stream into the array ptr at most nobj objects of size size. fread returns the number of objects read; this may be less than the number requested. feof and ferror must be used to determine status. (more…)


• • •
 



captcha PHP Script Free PHP captcha script free php
Website Design by WebWalas.com