Posts

Showing posts from December, 2016

C++: Working with files -2

Image
More about open(): File ModesGeneral form of open() function
   streamobject.open("filename",mode);
The second argument mode specifies the purpose for which the file is opened.The default value of mode are
ios::in for ifstream function meaning open for reading only
ios::out for ofstream function open for writing only
_________________________________________File Mode Parametersios::app   Appened to end-of-file
ios::ate    Go to end-of-file on opening
ios::binary   Binary file
ios::nocreateOpen fails if file doesn't exist
ios::noreplaceOpen files if file already exist
ios::truncDelete the contents of file if it exists
__________________________________________File Pointers and their ManipulationsEach file has two associated pointers known as file pointer.
1. Input pointer(get pointer) is used for reading the contents of a given file location.
2. Output pointer(put pointer) is used for writing to a file location.Functions for Manipulation of file Pointersseekg() Moves get pointer …

Popular Posts

C++: Selection sort using STL

Top 10 Web Sites Every Programmer Should Visit Daily