FreePrograms


C language is a middle level language. It is a structured language. C language is a case sensitive language. All syntax written in c language is in lower case. C is the basis for C++.
  CONTACT US   ABOUT US   PRIVACY  DISCLAIMER

FREE C PROGRAMS 

What is C C vs C++ vs Java Program Structure Data Types in C Basic Rules of C & C++
Functions in C If, Else Conditions Loops in C Switch Case Arrays
Pointers Structures in C Strings in C Command Line Arguments Type Casting
Linked Lists Recursion Binary Trees Inheritance Multiple Inheritance
Templates File I/O Object Oriented Programming Data Structures in C C interview Questions

File I/O : C Language Tutorial

fopen - open a file
fclose - close an open file
fread - read from a file
fwrite - write to a file
fseek/fsetpos - move a file pointer to somewhere in a file.
ftell/fgetpos - file pointer location.


To open a file you need to use the fopen function, which returns a FILE pointer as stated above. fclose returns zero if the file is closed properly.

Example:- FILE *fp; fp=fopen("c:\\new.txt", "w"); fprintf(fp, "New.\n");

Simple C Program to see how file handling works

Input File

Output File

COPYRIGHT 2009 ALL RIGHTS RESERVED FREECPROGRAMS.COM