<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://programmingexamples.net/w/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://programmingexamples.net/w/index.php?action=history&amp;feed=atom&amp;title=CPP%2FBinaryIO</id>
		<title>CPP/BinaryIO - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://programmingexamples.net/w/index.php?action=history&amp;feed=atom&amp;title=CPP%2FBinaryIO"/>
		<link rel="alternate" type="text/html" href="http://programmingexamples.net/w/index.php?title=CPP/BinaryIO&amp;action=history"/>
		<updated>2026-06-07T05:24:26Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.5</generator>

	<entry>
		<id>http://programmingexamples.net/w/index.php?title=CPP/BinaryIO&amp;diff=26&amp;oldid=prev</id>
		<title>Daviddoria: Created page with '==BinaryIO.cpp== &lt;source lang=&quot;cpp&quot;&gt; #include &lt;iostream&gt; #include &lt;fstream&gt; #include &lt;cstdlib&gt;  using namespace std; 		 void CWrite(); void CPPWrite();  string Filename = &quot;Test.b…'</title>
		<link rel="alternate" type="text/html" href="http://programmingexamples.net/w/index.php?title=CPP/BinaryIO&amp;diff=26&amp;oldid=prev"/>
				<updated>2010-06-23T11:35:40Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;#039;==BinaryIO.cpp== &amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt; #include &amp;lt;iostream&amp;gt; #include &amp;lt;fstream&amp;gt; #include &amp;lt;cstdlib&amp;gt;  using namespace std; 		 void CWrite(); void CPPWrite();  string Filename = &amp;quot;Test.b…&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==BinaryIO.cpp==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
#include &amp;lt;fstream&amp;gt;&lt;br /&gt;
#include &amp;lt;cstdlib&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using namespace std;&lt;br /&gt;
		&lt;br /&gt;
void CWrite();&lt;br /&gt;
void CPPWrite();&lt;br /&gt;
&lt;br /&gt;
string Filename = &amp;quot;Test.bin&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
    ofstream fout(Filename.c_str());&lt;br /&gt;
    &lt;br /&gt;
    fout &amp;lt;&amp;lt; 1 &amp;lt;&amp;lt; endl &amp;lt;&amp;lt; 2 &amp;lt;&amp;lt; endl;&lt;br /&gt;
&lt;br /&gt;
    fout.close();&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void CPPWrite()&lt;br /&gt;
{&lt;br /&gt;
  float fnum[4] = {11.22, -33.44, 55.66, 77.88};&lt;br /&gt;
  int i;&lt;br /&gt;
&lt;br /&gt;
  ofstream out(Filename.c_str(), ios::out | ios::binary);&lt;br /&gt;
  if(!out)&lt;br /&gt;
  {&lt;br /&gt;
	  cout &amp;lt;&amp;lt; &amp;quot;Cannot open file.&amp;quot;;&lt;br /&gt;
	  exit (1);&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  out.write((char *) &amp;amp;fnum, sizeof(fnum));&lt;br /&gt;
  out.close();&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
void CPPRead()&lt;br /&gt;
{&lt;br /&gt;
  ifstream in(&amp;quot;numbers.asc&amp;quot;, ios::in | ios::binary);&lt;br /&gt;
  if(!in) &lt;br /&gt;
  {&lt;br /&gt;
	  cout &amp;lt;&amp;lt; &amp;quot;Cannot open file.&amp;quot;;&lt;br /&gt;
	  exit (1);&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  in.read((char *) &amp;amp;fnum, sizeof(fnum));&lt;br /&gt;
  cout &amp;lt;&amp;lt; in.gcount() &amp;lt;&amp;lt; &amp;quot; bytes read.&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
  for (i=0; i&amp;lt;4; i++)&lt;br /&gt;
	  cout &amp;lt;&amp;lt; fnum[i] &amp;lt;&amp;lt; &amp;quot; &amp;quot;;&lt;br /&gt;
  in.close();&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
*/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Daviddoria</name></author>	</entry>

	</feed>