C

Fundamental concept of Problem solving
Introduction
Problem solving strategies
Program design & implementation
Introduction to C
Introduction to C
How to open C program code window
Description of C code window
Editing File
Saving and Running a program
The components of C language
Structure of C Program
A sample of C language program
C character set and keywords
C character set and keywords
The C character set
Identifiers
Key words
Data Types
Data Types
Primary Data Type
Secondary Data Type
Variables
Introduction
Rules for constructing variables names
Variable declaration
Assigning values to variables
Scope of variables: Local & Global
Constants
Introduction
Character constants
Integer constants
Real constants
Logical & String constants
C instruction set
Introduction
Type Declaration & Input/Output Instructions
Arithmetic Instructions
Control Instructions
Operators
Introduction
Arithmetic operators
Relational operators
Logical operators
Increment & Decrement operators
Bitwise operators
Conditional & ternary operators
The comma operators
Size of operator
Assignment operator
Type modifier
Expressions
Evaluation of expression
Automatic type conversion
Basic Input/Output
Introduction
Console I/O function
Disc & Port I/O function
Control Structures
Sequence control statements
Decision control & conditional statements
Case control statements
Repitition & loop control statements
Some more statements
Array and String
Introduction of Array
Array Declaration
Array Initialization
Two Dimensional Array
Multi Dimensional Array
String
Function and Recursion
Function Definition
Function Declaration
Function Call
Recursion
Pointers
Introduction
Pointer expression
Pointer & functions
Pointer & Array
Multi Dimensional Arrays & Pointer
Arrays of Pointer
Use of Pointer & functions
Structures
Introduction
Giving values to member
Structure Initialization
Comparison of structure variables
Arrays of structures
Arrays within structures
Structures within structures
Passing structure to function
Union
Introduction
Accessing a union member
Initialization of Union variable
Uses of Union
Dynamic Data Structure
Linked list
Stack
Queue
Data File Handling through C
Introduction
File operation
Opening & closing a data file
Creating a data file
Processing a data file
Unformatted data file
C Preprocessor & Macro
Introduction
Macro substitution directives
File inclusion
Compiler control directive
Command line parameter of C
Command line parameter
Header file
Header file
Use of library functions
Some Useful library functions

Data File Handling through C


Creating a data file

A data file must be created before it can be processed.
 
A stream-oriented data file can be created in two ways. One is to create the file directly, using a text editor or a word processor.
 
The other is to write a program that enters information into the computer and than writes it out to the data file.
 
Unformatted data files can only be created with such specially written programs.
 
Example:
 
Reading a data file-
 
The following program will read a line of text from a data file on a character by character basis, and display the text on the screen.
 
The program makes use of the library functions get and putchar to read and display the data.
 
An example program to read a line of text from a data file and display it on the screen:
 
 
Data file consisting entirely of strings can often be created and read more casually with programs that utilize special string-oriented library functions.
 
Some commonly used functions of this type are gets, puts, fgets and fputs.
 
The functions gets and puts read or write strings to or from the standard output devices, whereas fgets and fputs exchange strings with data files.