<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: 13.6 &#8212; Basic file I/O</title>
	<atom:link href="http://www.learncpp.com/cpp-tutorial/136-basic-file-io/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.learncpp.com/cpp-tutorial/136-basic-file-io/</link>
	<description></description>
	<lastBuildDate>Thu, 02 Feb 2012 21:20:10 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: chrys</title>
		<link>http://www.learncpp.com/cpp-tutorial/136-basic-file-io/comment-page-1/#comment-95247</link>
		<dc:creator>chrys</dc:creator>
		<pubDate>Fri, 11 Mar 2011 08:56:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=194#comment-95247</guid>
		<description>cstdlib!</description>
		<content:encoded><![CDATA[<p>cstdlib!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chrys</title>
		<link>http://www.learncpp.com/cpp-tutorial/136-basic-file-io/comment-page-1/#comment-95246</link>
		<dc:creator>chrys</dc:creator>
		<pubDate>Fri, 11 Mar 2011 08:54:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=194#comment-95246</guid>
		<description>For those that get an &quot;error: &#039;exit&#039; was not declared in this scope&quot; they have to include </description>
		<content:encoded><![CDATA[<p>For those that get an &#8220;error: &#8216;exit&#8217; was not declared in this scope&#8221; they have to include</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tylerfb11</title>
		<link>http://www.learncpp.com/cpp-tutorial/136-basic-file-io/comment-page-1/#comment-93588</link>
		<dc:creator>tylerfb11</dc:creator>
		<pubDate>Tue, 12 Oct 2010 19:55:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=194#comment-93588</guid>
		<description>hmmm.... Wordpress strikes again:

&lt;pre&gt;
cout  &lt;&gt; nMyFavNum;
cout  &lt;&gt; nMyFavLet;
&lt;/pre&gt;

should be:

&lt;pre&gt;
cin &gt;&gt; nMyFavNum;
cin &gt;&gt; nMyFavLet;
&lt;!--formatted--&gt;&lt;/pre&gt;

-Tyler</description>
		<content:encoded><![CDATA[<p>hmmm&#8230;. WordPress strikes again:</p>
<pre>
cout  &lt;&gt; nMyFavNum;
cout  &lt;&gt; nMyFavLet;
</pre>
<p>should be:</p>
<pre>
cin &gt;&gt; nMyFavNum;
cin &gt;&gt; nMyFavLet;
<!--formatted--></pre>
<p>-Tyler</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tylerfb11</title>
		<link>http://www.learncpp.com/cpp-tutorial/136-basic-file-io/comment-page-1/#comment-93587</link>
		<dc:creator>tylerfb11</dc:creator>
		<pubDate>Tue, 12 Oct 2010 19:48:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=194#comment-93587</guid>
		<description>It sure is possible! You can outf a varible just like you do with cout:

&lt;pre&gt;
int main()
{
    using namespace std;

    int nMyFavNum;
    char nMyFavLet;

    cout &lt;&gt; nMyFavNum;
    cout &lt;&gt; nMyFavLet;

    ofstream outf(&quot;MyFile.txt&quot;);

    outf &lt;&lt; &quot;My favorite number is: &quot;;
    outf &lt;&lt; nMyFavNum &lt;&lt; endl;
    outf &lt;&lt; &quot;My favorite letter is: &quot;;
    outf &lt;&lt; nMyFavLet &lt;&lt; endl;


    cout &lt;&lt; &quot;Thank-you!&quot; &lt;&lt; endl;
    system(&quot;pause&quot;);

  return 0;
}
&lt;!--formatted--&gt;&lt;/pre&gt;

-Tyler</description>
		<content:encoded><![CDATA[<p>It sure is possible! You can outf a varible just like you do with cout:</p>
<pre>
int main()
{
    using namespace std;

    int nMyFavNum;
    char nMyFavLet;

    cout &lt;&gt; nMyFavNum;
    cout &lt;&gt; nMyFavLet;

    ofstream outf(&quot;MyFile.txt&quot;);

    outf &lt;&lt; &quot;My favorite number is: &quot;;
    outf &lt;&lt; nMyFavNum &lt;&lt; endl;
    outf &lt;&lt; &quot;My favorite letter is: &quot;;
    outf &lt;&lt; nMyFavLet &lt;&lt; endl;

    cout &lt;&lt; &quot;Thank-you!&quot; &lt;&lt; endl;
    system(&quot;pause&quot;);

  return 0;
}
<!--formatted--></pre>
<p>-Tyler</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Coderdude</title>
		<link>http://www.learncpp.com/cpp-tutorial/136-basic-file-io/comment-page-1/#comment-82810</link>
		<dc:creator>Coderdude</dc:creator>
		<pubDate>Tue, 13 Apr 2010 03:05:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=194#comment-82810</guid>
		<description>Hmm... I&#039;m wondering if you can make the program so that the user can write to the file? Like, something with cin. Is it possible? It probably is, and has an easy explanation, but I just want to know if it is possible, and how to write the program to do this if it is possible. Thanks!!</description>
		<content:encoded><![CDATA[<p>Hmm&#8230; I&#8217;m wondering if you can make the program so that the user can write to the file? Like, something with cin. Is it possible? It probably is, and has an easy explanation, but I just want to know if it is possible, and how to write the program to do this if it is possible. Thanks!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: alex</title>
		<link>http://www.learncpp.com/cpp-tutorial/136-basic-file-io/comment-page-1/#comment-65360</link>
		<dc:creator>alex</dc:creator>
		<pubDate>Fri, 31 Jul 2009 12:43:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=194#comment-65360</guid>
		<description>Ignore my previous comment, I had overlooked the explanation below (use double backslashes):
“c:\\test\\abc.txt”

This worked for me.</description>
		<content:encoded><![CDATA[<p>Ignore my previous comment, I had overlooked the explanation below (use double backslashes):<br />
“c:\\test\\abc.txt”</p>
<p>This worked for me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: alex</title>
		<link>http://www.learncpp.com/cpp-tutorial/136-basic-file-io/comment-page-1/#comment-65355</link>
		<dc:creator>alex</dc:creator>
		<pubDate>Fri, 31 Jul 2009 11:49:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=194#comment-65355</guid>
		<description>I tried adding the complete path and filename, but it still outputs the file in the projects folder.
Is there a way to actually output the file where you want? It can&#039;t be that difficult...
Thanx</description>
		<content:encoded><![CDATA[<p>I tried adding the complete path and filename, but it still outputs the file in the projects folder.<br />
Is there a way to actually output the file where you want? It can&#8217;t be that difficult&#8230;<br />
Thanx</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chandrakant</title>
		<link>http://www.learncpp.com/cpp-tutorial/136-basic-file-io/comment-page-1/#comment-60181</link>
		<dc:creator>Chandrakant</dc:creator>
		<pubDate>Thu, 07 May 2009 10:33:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=194#comment-60181</guid>
		<description>if you given complete file path using single slash separator like &quot;c:\test\abc.txt&quot;  try with double slash separator like &quot;c:\\test\\abc.txt&quot;</description>
		<content:encoded><![CDATA[<p>if you given complete file path using single slash separator like &#8220;c:\test\abc.txt&#8221;  try with double slash separator like &#8220;c:\\test\\abc.txt&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.learncpp.com/cpp-tutorial/136-basic-file-io/comment-page-1/#comment-59722</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Sat, 02 May 2009 03:27:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=194#comment-59722</guid>
		<description>I do read all the comments (eventually).  I don&#039;t know why it wouldn&#039;t be outputting a file.  Perhaps you don&#039;t have permission to create files in the output directory?  Seems unlikely though.  You might do a google search on ofstream() and see if you can find reasons that it might fail.  I can&#039;t think of any other obvious reasons.</description>
		<content:encoded><![CDATA[<p>I do read all the comments (eventually).  I don&#8217;t know why it wouldn&#8217;t be outputting a file.  Perhaps you don&#8217;t have permission to create files in the output directory?  Seems unlikely though.  You might do a google search on ofstream() and see if you can find reasons that it might fail.  I can&#8217;t think of any other obvious reasons.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.learncpp.com/cpp-tutorial/136-basic-file-io/comment-page-1/#comment-59721</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Sat, 02 May 2009 03:25:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=194#comment-59721</guid>
		<description>I believe instead of specifying just a filename, you can specify a path and a filename.  I&#039;m not sure which directory corresponds to the windows desktop, but there is one somewhere on your hard drive...</description>
		<content:encoded><![CDATA[<p>I believe instead of specifying just a filename, you can specify a path and a filename.  I&#8217;m not sure which directory corresponds to the windows desktop, but there is one somewhere on your hard drive&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

