Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Reading data from file

Reply
Thread Tools

Reading data from file

 
 
Naeem
Guest
Posts: n/a
 
      01-12-2007
When i try to read a file using fstream in borland C++, result is
displayed with unusual characters.
I read a file "named ffile.txt" using ffile.read() or ffile>> into
variables of same width as these were written into file. But in both
cases unusual characters are displayed with file data making it
unreadable. Any suggestions....

 
Reply With Quote
 
 
 
 
Mike Wahler
Guest
Posts: n/a
 
      01-12-2007

"Naeem" <> wrote in message
news: ups.com...
> When i try to read a file using fstream in borland C++, result is
> displayed with unusual characters.
> I read a file "named ffile.txt" using ffile.read() or ffile>> into
> variables of same width as these were written into file. But in both
> cases unusual characters are displayed with file data making it
> unreadable. Any suggestions....


Show your code and example input. If your code is
long (more than ~100 lines, create a (complete,
compilable) sample program that gives the same
problem.

-Mike


 
Reply With Quote
 
 
 
 
Daniel T.
Guest
Posts: n/a
 
      01-13-2007
"Naeem" <> wrote:

> When i try to read a file using fstream in borland C++, result is
> displayed with unusual characters.
> I read a file "named ffile.txt" using ffile.read() or ffile>> into
> variables of same width as these were written into file. But in both
> cases unusual characters are displayed with file data making it
> unreadable. Any suggestions....


There are unusual characters in the file.
 
Reply With Quote
 
Jacek Dziedzic
Guest
Posts: n/a
 
      01-13-2007
Naeem wrote:
> When i try to read a file using fstream in borland C++, result is
> displayed with unusual characters.
> I read a file "named ffile.txt" using ffile.read() or ffile>> into
> variables of same width as these were written into file. But in both
> cases unusual characters are displayed with file data making it
> unreadable.


> Any suggestions....


Yes. Post the relevant code.

- J.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reading a file and resuming reading. Karim Ali Python 2 05-25-2007 02:04 PM
UnauthorizedAccessException when reading XML files (no problem when reading other file-types) blabla120@gmx.net ASP .Net 0 09-15-2006 02:08 PM
An Automated process of watching a network file folder, reading a file in it and deleting the file using ASP.NET ? Luis Esteban Valencia Muņoz ASP .Net 3 06-04-2005 10:56 AM
reading the DB vs. reading a text file...performance preference? Darrel ASP .Net 3 11-11-2004 02:27 PM
reading output file data as input data Stephen Moon Perl Misc 5 02-29-2004 02:16 PM



Advertisments