![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Newbie
Join Date: Feb 2006
Location: India
Posts: 25
Rep Power: 0
![]() |
Get and put file pointers
Do the get and put file pointers shift simulataneously ??
For eg if I shift the position of the get pointer , does the put pointer shift simultaneously n vice versa??? Pls tell if the cases for the above query are different for the objects of fstream , ifstream and ofstream class ![]() |
|
|
|
|
|
#2 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
If I understand the question, the answer is 'no'.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#3 |
|
Newbie
Join Date: Feb 2006
Location: India
Posts: 25
Rep Power: 0
![]() |
I m asking that say if I vary the get pointer for a file using seekg() , does the put pointer also shift along with it and go to the byte position<where the get pointer now is>?
|
|
|
|
|
|
#4 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
No. Incidentally, if you're using Windows, I recommend binary mode (Windows' default is text). Text mode does several things, one of which is to make the accurate use of seeks and tells problematic. Binary mode works just fine; it's all *nix has.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|