473,396 Members | 1,748 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,396 software developers and data experts.

about filehandling

TVS
file handling in c++ using ifstream and ofstream is creating a problem
when i wanted to write to a file using <ofstream>.write() member
function. When I try to retrieve it back using an read() memeber for
an ifstream object i am not able to find any data in the object. Can
you tell me better ways to store into files and retrieve from the files.

Jul 23 '05 #1
3 1636
TVS wrote:

file handling in c++ using ifstream and ofstream is creating a problem
when i wanted to write to a file using <ofstream>.write() member
function. When I try to retrieve it back using an read() memeber for
an ifstream object i am not able to find any data in the object. Can
you tell me better ways to store into files and retrieve from the files.


Please show some test code, which gives you troubles.
You made a mistake somewhere and talking about
actual code is a good way to show you, where you went
wrong.

--
Karl Heinz Buchegger
kb******@gascad.at
Jul 23 '05 #2
"TVS" <tv*********@gmail.com> writes:
file handling in c++ using ifstream and ofstream is creating a problem
when i wanted to write to a file using <ofstream>.write() member
function. When I try to retrieve it back using an read() memeber for
an ifstream object i am not able to find any data in the object. Can
you tell me better ways to store into files and retrieve from the files.

Can you send a little (minimal) file to illustrate the problem?
Sounds like a buffering issue.

Jul 23 '05 #3
TVS wrote:
file handling in c++ using ifstream and ofstream is creating a problem when i wanted to write to a file using <ofstream>.write() member
function. When I try to retrieve it back using an read() memeber for
an ifstream object i am not able to find any data in the object.


I would guess that you don't open the files in binary mode: this may
indeed mess up some the data. Otherwise, I would expect that saving
PODs in binary mode should work as long as you stay on the same
machine,
the same compiler version, etc. In general, you should, however, format
your data even when using a binary format.

What exactly is your problem and what does your code look like: with
the information you provided we cannot do much more than guess what
you try to do.
--
<mailto:di***********@yahoo.com> <http://www.dietmar-kuehl.de/>
<http://www.contendix.com> - Software Development & Consulting

Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: eScrewDotCom | last post by:
eScrew Welcome to eScrew! eScrew is eScrew and this is eScrew story. eScrew will tell you eScrew story if you promise eScrew to consider eScrew story as joke. eScrew story is very funny. eScrew...
220
by: Brandon J. Van Every | last post by:
What's better about Ruby than Python? I'm sure there's something. What is it? This is not a troll. I'm language shopping and I want people's answers. I don't know beans about Ruby or have...
54
by: Brandon J. Van Every | last post by:
I'm realizing I didn't frame my question well. What's ***TOTALLY COMPELLING*** about Ruby over Python? What makes you jump up in your chair and scream "Wow! Ruby has *that*? That is SO...
8
by: eScrewDotCom | last post by:
eScrew Welcome to eScrew! eScrew is eScrew and this is eScrew story. eScrew will tell you eScrew story if you promise eScrew to consider eScrew story as joke. eScrew story is very funny. eScrew...
125
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from...
5
by: eScrewDotCom | last post by:
www.eScrew.com eScrew Welcome to eScrew! eScrew is eScrew and this is eScrew story. eScrew will tell you eScrew story if you promise eScrew to consider eScrew story as joke. eScrew story is...
0
by: eScrewDotCom | last post by:
eScrew Welcome to eScrew! eScrew is eScrew and this is eScrew story. eScrew will tell you eScrew story if you promise eScrew to consider eScrew story as joke. eScrew story is very funny. eScrew...
7
by: Edward Yang | last post by:
A few days ago I started a thread "I think C# is forcing us to write more (redundant) code" and got many replies (more than what I had expected). But after reading all the replies I think my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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.