I have some questions about file manipulation;
a.) I'm a little confused about getting and delivering a pointer in C ++. I am showing the correct position of the get pointer and place the pointer.
MyFile . seekg ( 0 , ios :: beg ) ; MyFile . seekp ( -10 , ios :: end ) ; index :0 1 2 3 4 5 6 7 8 9 10 ... -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 __________________________________________________________________ ^ ^ ^ ^ ^ ^ get Pointer put pointer Myfile . get ( character ) ; MyFile . write ( SomeString, 4 ) ; MyFile . flush ( ) ; index :0 1 2 3 4 5 6 7 8 9 10 ... -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 __________________________________________________________________ ^ ^ ^ ^ ^ ^ get Pointer put pointer
i.) Are Seekg and seekp always guarentee, which get a pointer to a pointer, always show the correct position?
ii.) If you know more about this topic, can you show / give me some points, I must be careful when I use them (if any)
b.) is
FileIN . seekg ( 1, ifstream :: cur ) ;
equal
FileIN . seekg ( 1, ios :: cur ) ;
Platform: linux File Format: Binary
user478571
source share