CoderSource.net
Search
about binary file
Started by kmo at 09-19-2005 7:40 AM. Topic has 2 replies.

Print Search « Previous Thread Next Thread »
   09-19-2005, 7:40 AM
kmo is not online. Last active: 9/19/2005 10:46:14 AM kmo

Top 50 Posts
Joined on 09-19-2005
Posts 1
Idea [I] about binary file

Can data be read line by line from binary file?

If possible, please answer with sample coding.


   Report 
   01-13-2006, 1:42 AM
shiva_alan is not online. Last active: 2/7/2006 3:18:42 AM shiva_alan

Top 50 Posts
Joined on 01-13-2006
Posts 1
Re: about binary file
 kmo wrote:

Can data be read line by line from binary file?

If possible, please answer with sample coding.


as per better of my knowledge we can read line by line only in txt mode only. it is not possible.
because the pointer will points from which location to which location to read in binary file so it is not possible ..
if u came to know it is possible send mail

thanks and regards

   Report 
   03-14-2006, 3:23 PM
jackinc is not online. Last active: 3/14/2006 8:12:28 PM jackinc

Top 50 Posts
Joined on 03-10-2006
Posts 2
Re: about binary file

yes it is possible ....first you have to create a fstream object and associate it with a file to be read

fstream fin('myfile.cpp')

to read the the file in binary mode just add another parameter argument to this function

fstream fin('myfile.cpp',ios::binary)

ios=input/output stream

:: = scope resolution operator

myfile.cpp = file being read

after you read in the file in binary format then you can construct your own function(c++ classes may have certain functions for this job) to do watever you want with the data


   Report 
Codersource.Net » Programming » C++ Programming » about binary file

MENU
Home
MFC 
C++
.Net
WIN32
Programming
Forum
My Articles
Welcome to Codersource.Net Login | Register | Faq  

Google
 

NOTES:


Thanks for visiting our CoderSource.net. This site will be improved with more articles. Interested visitors can also submit their articles through the Submit Article link.Your article will also be published after due consideration by the editor. 

© Copyright 2003. All rights on content reserved by CoderSource.net. Contact    About Us