473,405 Members | 2,445 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

how seekg and seekp is implemented

Could any one tell how seekg and seekp are implemented...
I have a stream of data.. through which I need to read from a particular position and particular length..
the prototype of the function is

getBits(char* stream , int offset , int length , void * value);
I need to implement this function..so could I get something from the seekg so that its helpful for me in coding..

Thanks in advance..
Oct 22 '07 #1
2 4885
weaknessforcats
9,208 Expert Mod 8TB
These functions operate on an offset calculation from the beginning, end, or current position in the stream. You are responsible to ensure the stream confroms to the calculation.

Use seekg, tellg, seekp and tellp for char streams and fgetpos and fsetpos for wide streams.
Oct 22 '07 #2
These functions operate on an offset calculation from the beginning, end, or current position in the stream. You are responsible to ensure the stream confroms to the calculation.

Use seekg, tellg, seekp and tellp for char streams and fgetpos and fsetpos for wide streams.
Thanks for reply..
I need the code of those functions..
Oct 23 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Kapil Khosla | last post by:
Hi, I am trying to move the file pointer back to the original location, but not able to using seekg, can someone help ? Thanks, Kapil #include "stdafx.h" using std::cerr; using std::endl;...
1
by: wtnt | last post by:
Hello. I've searched all over and haven't seen another thread with this problem. Please bear with me as I try to explain. thanks. :) I have some programs that need to be cross-platform...
1
by: Maitre Bart | last post by:
The following simple program overwrites the content of an ostriungstream object. #include <iostream> #include <sstream> using namespace std; int main() {
2
by: Assertor | last post by:
Hi, All. (VC++6.0) I found some strange thins when using getline() and seekg() of std::ifstream. After the file position of an open file was shift to the end of the file, seekg() did not...
5
by: wobudui | last post by:
Hi everyboday, I have some trouble in dealing with the file stream. My souce code Listed hear: int main() { char buffer={0}; ofstream ofile.open("mydata.in",ios::app); ofile.seekp(10);...
4
by: Paolo | last post by:
Hi all! I'm using ofstream and seekp to write a file. The problem is I have to write a very big file, more than 4 Gb, but the streamoff that I have to pass to seekp isn't a 64 bit int (it's a...
1
by: greek | last post by:
Hi I have to write a prg for the following question.. A file carsale_june.txt stores the number of small and medium-sized of cars sold in the month of June by a car company. The first line of...
4
by: naph | last post by:
Hello, I wrote a code that deals with data files. Each file has a header. At sum stage when I use seekg or seekp it erases the header of the file. What could be the cause of this? naph
1
by: avinash6174 | last post by:
I need to know the code for seekg and seekp is implemented inside the complier.. Thanks in advance ..
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.