Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

open binary files

Status
Not open for further replies.

tigerclaw

Programmer
Sep 12, 2001
15
0
0
US
is there a way to open binary files read them in a program?
also is there a way to convert one filetype to another(like pdf to text)?
thank you for your continued patience. live life to the fullest. we only go around once.
 
Opening binary files is not difficult. If you <stdio.h> then you could use the &quot;b&quot; option with fopen.
Code:
 inf = fopen(&quot;MyFile.Dat&quot;, &quot;rb&quot;);
to open for reading in binary mode.

With <fstream.h> you could use &quot;ios::binary&quot; option.
Code:
ifstream inf(&quot;MyFile.Dat&quot;, ios::in | ios::binary)
to open for reading in minary mode.

To convert from one format to another depends on what formats you want. PDF is a proprietary format owned by Adobe. You would need a library that can read this format. Other formats are easier such as reading a comma delimited file and converting to a columnar format. You can do this on your own. James P. Cottingham

I am the Unknown lead by the Unknowing.
I have done so much with so little
for so long that I am now qualified
to do anything with nothing.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top