<?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[ein datei zu einem fonktion schicken?? bitte helfen!!]]></title><description><![CDATA[<p>Hi Leute,<br />
Kann jemand mir helfen? BITTE<br />
wie kann man ein datei zu einem funktion , der im main aufgerufen wird,schicken??</p>
<p>z.B.:<br />
es geht nicht wie folgendes!! wieso????<br />
void main()<br />
{<br />
void showdatei(fstream) ???<br />
fstream fin(&quot;test.txt&quot;); ???<br />
showdatei(fin); ???<br />
}</p>
<p>void showdatei(fstream f)<br />
{<br />
string str;<br />
f.open();<br />
f.getline(str);<br />
cout&lt;&lt;str;<br />
}</p>
<p>MFG</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/133621/ein-datei-zu-einem-fonktion-schicken-bitte-helfen</link><generator>RSS for Node</generator><lastBuildDate>Fri, 28 Aug 2026 00:26:34 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/133621.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 19 Jan 2006 11:30:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to ein datei zu einem fonktion schicken?? bitte helfen!! on Thu, 19 Jan 2006 11:31:31 GMT]]></title><description><![CDATA[<p>Hi Leute,<br />
Kann jemand mir helfen? BITTE<br />
wie kann man ein datei zu einem funktion , der im main aufgerufen wird,schicken??</p>
<p>z.B.:<br />
es geht nicht wie folgendes!! wieso????<br />
void main()<br />
{<br />
void showdatei(fstream) ???<br />
fstream fin(&quot;test.txt&quot;); ???<br />
showdatei(fin); ???<br />
}</p>
<p>void showdatei(fstream f)<br />
{<br />
string str;<br />
f.open();<br />
f.getline(str);<br />
cout&lt;&lt;str;<br />
}</p>
<p>MFG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/970442</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/970442</guid><dc:creator><![CDATA[diyarigurbet]]></dc:creator><pubDate>Thu, 19 Jan 2006 11:31:31 GMT</pubDate></item><item><title><![CDATA[Reply to ein datei zu einem fonktion schicken?? bitte helfen!! on Thu, 19 Jan 2006 11:32:43 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">void main() 
{ 
void showdatei(fstream) ??? 
fstream fin(&quot;test.txt&quot;); ??? 
showdatei(fin); ??? 
} 

void showdatei(fstream f) 
{ 
string str; 
f.open(); 
f.getline(str); 
cout&lt;&lt;str; 
}
</code></pre>
<p>danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/970445</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/970445</guid><dc:creator><![CDATA[dern000b]]></dc:creator><pubDate>Thu, 19 Jan 2006 11:32:43 GMT</pubDate></item><item><title><![CDATA[Reply to ein datei zu einem fonktion schicken?? bitte helfen!! on Thu, 19 Jan 2006 11:34:33 GMT]]></title><description><![CDATA[<p>sag mal<br />
wo definierst du deine funktion showdatei?<br />
doch net in main ^^<br />
fin ist richtig deklariert<br />
showdatei(fin) ist doch auch rigth.</p>
<p>überarbeite deinen kot und dann stelltste den nochmal rein</p>
<p>cu<br />
dern00b</p>
]]></description><link>https://www.c-plusplus.net/forum/post/970447</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/970447</guid><dc:creator><![CDATA[dern00b]]></dc:creator><pubDate>Thu, 19 Jan 2006 11:34:33 GMT</pubDate></item><item><title><![CDATA[Reply to ein datei zu einem fonktion schicken?? bitte helfen!! on Thu, 19 Jan 2006 11:35:42 GMT]]></title><description><![CDATA[<p>Du mußt den Prototyp der Funktion außerhalb der main (btw, das heißt &quot;<strong>int</strong> main()&quot;) deklarieren:</p>
<pre><code class="language-cpp">void showdatei(fstream&amp;);

int main()
{
  fstream fin(&quot;test.txt&quot;);
  showdatei(fin);
  return 0;
}

void showdatei(fstream&amp; file)
{
  string str; 
  file.getline(str); 
  cout&lt;&lt;str; 
}
</code></pre>
<p>(PS: Die Datei ist schon offen, also brauchst du den Aufruf f.open() in deiner Funktion nicht)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/970448</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/970448</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Thu, 19 Jan 2006 11:35:42 GMT</pubDate></item><item><title><![CDATA[Reply to ein datei zu einem fonktion schicken?? bitte helfen!! on Thu, 19 Jan 2006 12:37:20 GMT]]></title><description><![CDATA[<p>CStoll schrieb:</p>
<blockquote>
<p>Du mußt den Prototyp der Funktion außerhalb der main (btw, das heißt &quot;<strong>int</strong> main()&quot;) deklarieren:</p>
<pre><code class="language-cpp">void showdatei(fstream&amp;);
</code></pre>
<p>(PS: Die Datei ist schon offen, also brauchst du den Aufruf f.open() in deiner Funktion nicht)</p>
</blockquote>
<p>ich danke CStoll...<br />
es ist fonktioniert...</p>
<p>MFG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/970501</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/970501</guid><dc:creator><![CDATA[diyarigurbet]]></dc:creator><pubDate>Thu, 19 Jan 2006 12:37:20 GMT</pubDate></item><item><title><![CDATA[Reply to ein datei zu einem fonktion schicken?? bitte helfen!! on Thu, 19 Jan 2006 12:53:56 GMT]]></title><description><![CDATA[<p>CStoll schrieb:</p>
<blockquote>
<p>Du mußt den Prototyp der Funktion außerhalb der main (btw, das heißt &quot;<strong>int</strong> main()&quot;) deklarieren:</p>
</blockquote>
<p>Eigentlich &quot;muss&quot; man das nicht, aber man &quot;sollte&quot;.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/970512</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/970512</guid><dc:creator><![CDATA[Bashar]]></dc:creator><pubDate>Thu, 19 Jan 2006 12:53:56 GMT</pubDate></item></channel></rss>