UNIT 03 - Lecture 26 - Working With Files
UNIT 03 - Lecture 26 - Working With Files
Semester : II
SKASC 1
Topic to be Discussed
Representing 2594
I 2 I
Bytes
0 0 0 0 1 0 1 0 0 1 0 0 0 1 Binary
0 0 Format
I 4 I
Bytes
2 5 9 4 Character
Format
Sequential Input and Output Operations
○ ……
○ ……
○ infile.open(argv[1]);
○
……
○
……
○
outfile.open(argv[2]);
○
#include <iostream>
cout << "There are " << argc << " arguments:" << endl;
return 0;
}
#include <iostream>
cout << "There are " << argc << " arguments:" << endl;
return 0;
}
//output
Summary
File Modes
File Pointer
Functions for Manipulations of File Pointers
• Seek Function with Absolute Position
• Seek Function with Specifying the Offset
Sequential Input and Output Operations
Reading and Writing a Class Object
File operations
• ifstream
• ofstream
• fstream
• fopen()
• fclose()
• eof()
Streams
• File input stream
• File output stream
Next Session
Function Templates
Thank You