Showing posts with label file in c. Show all posts
Showing posts with label file in c. Show all posts

Saturday, October 17, 2009

FILE

COMMAND LINE ARGUMENT :- Command line argument is parameter supplied to a program when the program is invoked . This parameter may represent a File name the program should process . In fact main() can take two argument (from the operating system) called ARGC and ARGV .

The variable argc is an argument counter that counts the number of Argument on the commands line .Whereas argv is an argument vector and represent an array of character pointers that points to the command line argument .The size of this array will be equal to the value of argc .

Sunday, September 20, 2009

FILE IN C

01.WHAT IS FILE IN C?
Ans: A file is a place on the disk where a group of related data stored in. the keyword "FILE" is a data type that is defined in the I/O libary . The FILE type pointer contains all the infomation about the FILE is subsequently used as a communication link between the system and the program.

OPENING THE FILE: when working witha stream-orinted data file , the first step establish a "buffer area" ,where information is temporarily stored while being transferred between the computer's memory and data file .This buffer area allows information to be read from or written to the data file more rapidly than would otherwise be possible .
The buffer area is establish by writing
FILE *fp1 ;