<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Inhalt von 2D-Array in File (.txt) speichern]]></title><description><![CDATA[<p>Hallo</p>
<p>Wie kann man am einfachsten den Inhalt eines Arrays (float values) in einem txt-File abspeichern? Danke im Voraus für Deine Hilfe.<br />
houver</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/88691/inhalt-von-2d-array-in-file-txt-speichern</link><generator>RSS for Node</generator><lastBuildDate>Sun, 05 Jul 2026 21:41:37 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/88691.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 12 Oct 2004 15:31:31 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Inhalt von 2D-Array in File (.txt) speichern on Tue, 12 Oct 2004 15:31:31 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Wie kann man am einfachsten den Inhalt eines Arrays (float values) in einem txt-File abspeichern? Danke im Voraus für Deine Hilfe.<br />
houver</p>
]]></description><link>https://www.c-plusplus.net/forum/post/626993</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/626993</guid><dc:creator><![CDATA[houver]]></dc:creator><pubDate>Tue, 12 Oct 2004 15:31:31 GMT</pubDate></item><item><title><![CDATA[Reply to Inhalt von 2D-Array in File (.txt) speichern on Wed, 13 Oct 2004 13:03:28 GMT]]></title><description><![CDATA[<p>Ungetestet, etwa so:</p>
<pre><code>include &lt;fstream.h&gt;

void main()
{
  using namespace std;

  AnsiString fname=&quot;xyz.txt&quot;; 
  int myarray[XMAX][YMAX];

  ofstream oFile(fname.c_str(), ios::out);

  for (int iy=0;iy&lt;XMAX;iy++)
  {
    for (int ix=0;ix&lt;YMAX;ix++)      
    {
      oFile&lt;&lt;myarray[ix][iy]&lt;&lt;endl;
    }
  }
  oFile.close();
}
</code></pre>
<p>Allerdings könntest du ruhig vorher mal etwas Gehirnschmalz investieren und deinen Vorschlag dann posten. Die Suchfunktion &amp; FAQ helfen dir zu dem Thema auch.</p>
<p>mfG</p>
<p>robi1806</p>
]]></description><link>https://www.c-plusplus.net/forum/post/627721</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/627721</guid><dc:creator><![CDATA[robi1806]]></dc:creator><pubDate>Wed, 13 Oct 2004 13:03:28 GMT</pubDate></item><item><title><![CDATA[Reply to Inhalt von 2D-Array in File (.txt) speichern on Fri, 15 Oct 2004 01:56:40 GMT]]></title><description><![CDATA[<p>ich hab folgendes getestet: matrix hat row zeilen und col spalten</p>
<p>ofstream myfile (&quot;my.out&quot;);</p>
<p>if (myfile.is_open() )<br />
{<br />
for (int i=0; i&lt;row; i++)<br />
{<br />
for (int j=0; j&lt;col; j++)<br />
{<br />
myfile &lt;&lt; matrix[i][j] &lt;&lt; &quot;\t&quot; ;<br />
}<br />
myfile &lt;&lt; endl;<br />
}<br />
myfile.close();<br />
}</p>
<p>man darf nicht vergessen ein endl einzubauen nach jeder zeile. robi hat das oben nach jedem elemnt, d.h. eine n x m matrix wird immer als n*m x 1 vector geschrieben.<br />
duschl</p>
]]></description><link>https://www.c-plusplus.net/forum/post/629092</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/629092</guid><dc:creator><![CDATA[duschl]]></dc:creator><pubDate>Fri, 15 Oct 2004 01:56:40 GMT</pubDate></item><item><title><![CDATA[Reply to Inhalt von 2D-Array in File (.txt) speichern on Fri, 15 Oct 2004 13:28:55 GMT]]></title><description><![CDATA[<p>&lt;delete&gt;...&lt;/delete&gt;<br />
ooops, falsches Posting.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/629093</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/629093</guid><dc:creator><![CDATA[Ingo]]></dc:creator><pubDate>Fri, 15 Oct 2004 13:28:55 GMT</pubDate></item></channel></rss>