<?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[error C2248, streamcode macht mucken]]></title><description><![CDATA[<p>Hallo allerseits,</p>
<p>ich hab z.Z. in Info die Aufgabe aus einer Datei per Zeilensuche auszulesen.</p>
<p>Hier mal eben die Code-Zeilen auf die es ankommt:</p>
<pre><code>void main (void)
{
	double l[4],delta[3],delta1[3],pi=3.14159,G,b[3],F[3],A[3][3];

	ifstream balken(&quot;Balken.dat&quot;);
	ofstream lager(&quot;Lager.dat&quot;);

	if (!balken)
	{
		cerr &lt;&lt; &quot;Es ist ein Fehler beim Oeffnen der Datei aufgetreten!&quot; &lt;&lt; endl;
	}
	else
	{
		G=keyfind(&quot;G: &quot;,balken);
		delta[0]=keyfind(&quot;D1:&quot;,balken);
		delta[1]=keyfind(&quot;D2:&quot;,balken);
		delta[2]=keyfind(&quot;D3:&quot;,balken);
		l[0]=keyfind(&quot;L1:&quot;,balken);
		l[1]=keyfind(&quot;L2:&quot;,balken);
		l[2]=keyfind(&quot;L3:&quot;,balken); 
		l[3]=keyfind(&quot;L4:&quot;,balken);
</code></pre>
<pre><code>double keyfind(string schluessel,ifstream balken)
{

	string Zeile;
	istringstream iss;
	while (balken.eof())
	{
		while(getline(balken, Zeile));
		{			
			if (Zeile[0]==schluessel[0]  &amp;&amp; Zeile[1]==schluessel[1] &amp;&amp; Zeile[2]==schluessel[2])
			{
				Zeile.erase(0,3);
				double D;
				iss.str(Zeile);
				iss &gt;&gt; D;
				return D;
			}
		}
	}
}
</code></pre>
<p>Ansonsten is an dem Programm alles top.</p>
<p>Wenn ich nun allerdings die Datei durchrechnen lasse bekomme ich folgende Fehlermeldung:</p>
<pre><code>&gt;C:\Programme\Microsoft Visual Studio 8\VC\include\fstream(675) : error C2248: &quot;std::basic_ios&lt;_Elem,_Traits&gt;::basic_ios&quot;: 
Kein Zugriff auf private Member, dessen Deklaration in der std::basic_ios&lt;_Elem,_Traits&gt;-Klasse erfolgte.
1&gt;        with
1&gt;        [
1&gt;            _Elem=char,
1&gt;            _Traits=std::char_traits&lt;char&gt;
1&gt;        ]
1&gt;        C:\Programme\Microsoft Visual Studio 8\VC\include\ios(151): Siehe Deklaration von 'std::basic_ios&lt;_Elem,_Traits&gt;::basic_ios'
1&gt;        with
1&gt;        [
1&gt;            _Elem=char,
1&gt;            _Traits=std::char_traits&lt;char&gt;
1&gt;        ]
1&gt;        Diese Diagnose trat in der vom Compiler generierten Funktion &quot;std::basic_ifstream&lt;_Elem,_Traits&gt;::basic_ifstream(const std::basic_ifstream&lt;_Elem,_Traits&gt; &amp;)&quot; auf.
1&gt;        with
1&gt;        [
1&gt;            _Elem=char,
1&gt;            _Traits=std::char_traits&lt;char&gt;
1&gt;        ]
</code></pre>
<p>Und damit kann ich mal überhaupt nix anfangen.<br />
Ich hab auch schon per google gesucht, aber nichts gefunden, was mir weitergeholfen hat.</p>
<p>Könnt ihr mir auf die Sprünge helfen?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/215483/error-c2248-streamcode-macht-mucken</link><generator>RSS for Node</generator><lastBuildDate>Mon, 12 Oct 2026 07:53:45 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/215483.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 11 Jun 2008 15:07:32 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to error C2248, streamcode macht mucken on Wed, 11 Jun 2008 15:07:32 GMT]]></title><description><![CDATA[<p>Hallo allerseits,</p>
<p>ich hab z.Z. in Info die Aufgabe aus einer Datei per Zeilensuche auszulesen.</p>
<p>Hier mal eben die Code-Zeilen auf die es ankommt:</p>
<pre><code>void main (void)
{
	double l[4],delta[3],delta1[3],pi=3.14159,G,b[3],F[3],A[3][3];

	ifstream balken(&quot;Balken.dat&quot;);
	ofstream lager(&quot;Lager.dat&quot;);

	if (!balken)
	{
		cerr &lt;&lt; &quot;Es ist ein Fehler beim Oeffnen der Datei aufgetreten!&quot; &lt;&lt; endl;
	}
	else
	{
		G=keyfind(&quot;G: &quot;,balken);
		delta[0]=keyfind(&quot;D1:&quot;,balken);
		delta[1]=keyfind(&quot;D2:&quot;,balken);
		delta[2]=keyfind(&quot;D3:&quot;,balken);
		l[0]=keyfind(&quot;L1:&quot;,balken);
		l[1]=keyfind(&quot;L2:&quot;,balken);
		l[2]=keyfind(&quot;L3:&quot;,balken); 
		l[3]=keyfind(&quot;L4:&quot;,balken);
</code></pre>
<pre><code>double keyfind(string schluessel,ifstream balken)
{

	string Zeile;
	istringstream iss;
	while (balken.eof())
	{
		while(getline(balken, Zeile));
		{			
			if (Zeile[0]==schluessel[0]  &amp;&amp; Zeile[1]==schluessel[1] &amp;&amp; Zeile[2]==schluessel[2])
			{
				Zeile.erase(0,3);
				double D;
				iss.str(Zeile);
				iss &gt;&gt; D;
				return D;
			}
		}
	}
}
</code></pre>
<p>Ansonsten is an dem Programm alles top.</p>
<p>Wenn ich nun allerdings die Datei durchrechnen lasse bekomme ich folgende Fehlermeldung:</p>
<pre><code>&gt;C:\Programme\Microsoft Visual Studio 8\VC\include\fstream(675) : error C2248: &quot;std::basic_ios&lt;_Elem,_Traits&gt;::basic_ios&quot;: 
Kein Zugriff auf private Member, dessen Deklaration in der std::basic_ios&lt;_Elem,_Traits&gt;-Klasse erfolgte.
1&gt;        with
1&gt;        [
1&gt;            _Elem=char,
1&gt;            _Traits=std::char_traits&lt;char&gt;
1&gt;        ]
1&gt;        C:\Programme\Microsoft Visual Studio 8\VC\include\ios(151): Siehe Deklaration von 'std::basic_ios&lt;_Elem,_Traits&gt;::basic_ios'
1&gt;        with
1&gt;        [
1&gt;            _Elem=char,
1&gt;            _Traits=std::char_traits&lt;char&gt;
1&gt;        ]
1&gt;        Diese Diagnose trat in der vom Compiler generierten Funktion &quot;std::basic_ifstream&lt;_Elem,_Traits&gt;::basic_ifstream(const std::basic_ifstream&lt;_Elem,_Traits&gt; &amp;)&quot; auf.
1&gt;        with
1&gt;        [
1&gt;            _Elem=char,
1&gt;            _Traits=std::char_traits&lt;char&gt;
1&gt;        ]
</code></pre>
<p>Und damit kann ich mal überhaupt nix anfangen.<br />
Ich hab auch schon per google gesucht, aber nichts gefunden, was mir weitergeholfen hat.</p>
<p>Könnt ihr mir auf die Sprünge helfen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1527134</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1527134</guid><dc:creator><![CDATA[sp.ChefKoch]]></dc:creator><pubDate>Wed, 11 Jun 2008 15:07:32 GMT</pubDate></item><item><title><![CDATA[Reply to error C2248, streamcode macht mucken on Wed, 11 Jun 2008 15:14:38 GMT]]></title><description><![CDATA[<blockquote>
<p>Kein Zugriff auf private Member, dessen Deklaration in der std::basic_ios&lt;_Elem,_Traits&gt;-Klasse erfolgte.</p>
</blockquote>
<p>Das sagt ja eigentlich alles. Jetzt musst du dort nur noch Doppelklick machen und dann zeigt er dir ja an, WO das genau ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1527138</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1527138</guid><dc:creator><![CDATA[drakon]]></dc:creator><pubDate>Wed, 11 Jun 2008 15:14:38 GMT</pubDate></item><item><title><![CDATA[Reply to error C2248, streamcode macht mucken on Wed, 11 Jun 2008 15:18:59 GMT]]></title><description><![CDATA[<p>ja dann springt er mir hier hin, soweit war ich auch schon, aber damit kann ich ja noch weniger anfangen.</p>
<pre><code>private:
	_Myfb _Filebuffer;	// the file buffer
	};

 #if defined(_DLL_CPPLIB) &amp;&amp; !defined(_M_CEE_PURE)
</code></pre>
<p>Es sollte gesagt werden, dass ich Maschbau-Student bin und der Info-Unterricht recht für die Hose is.<br />
Was allerdings auch keine Entschuldigung sein soll.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1527140</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1527140</guid><dc:creator><![CDATA[sp.ChefKoch]]></dc:creator><pubDate>Wed, 11 Jun 2008 15:18:59 GMT</pubDate></item><item><title><![CDATA[Reply to error C2248, streamcode macht mucken on Wed, 11 Jun 2008 15:21:18 GMT]]></title><description><![CDATA[<p>Jo, hier:</p>
<pre><code class="language-cpp">double keyfind(string schluessel,ifstream balken)
{
    //...
}
</code></pre>
<p>Streams sind nicht kopierbar. Du musst eine Referenz übergeben:</p>
<pre><code class="language-cpp">double keyfind(string schluessel,ifstream&amp; balken);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1527144</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1527144</guid><dc:creator><![CDATA[Tachyon]]></dc:creator><pubDate>Wed, 11 Jun 2008 15:21:18 GMT</pubDate></item><item><title><![CDATA[Reply to error C2248, streamcode macht mucken on Wed, 11 Jun 2008 15:25:17 GMT]]></title><description><![CDATA[<p>wow...</p>
<p>ein kleines Zeichen und kein weiterer Fehler. Vielen Dank.<br />
Wenn sich doch noch ein Fehler findet werd ich mich hier nochmal melden.</p>
<p>Vielen Dank.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1527146</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1527146</guid><dc:creator><![CDATA[sp.ChefKoch]]></dc:creator><pubDate>Wed, 11 Jun 2008 15:25:17 GMT</pubDate></item><item><title><![CDATA[Reply to error C2248, streamcode macht mucken on Wed, 11 Jun 2008 16:47:44 GMT]]></title><description><![CDATA[<p>sp.ChefKoch schrieb:</p>
<blockquote>
<pre><code>void main (void)
</code></pre>
</blockquote>
<p>Wird das von deinem Compiler toleriert? Mach es doch standardgemäss:</p>
<pre><code class="language-cpp">int main() // oder int main(void), wobei ich zu Ersterem rate
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1527186</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1527186</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Wed, 11 Jun 2008 16:47:44 GMT</pubDate></item><item><title><![CDATA[Reply to error C2248, streamcode macht mucken on Wed, 11 Jun 2008 18:00:51 GMT]]></title><description><![CDATA[<p>ja wird es.</p>
<p>hier mal das ganze programm, falls es jemanden interessiert.<br />
allerdings ist noch irgendwo ein fehler, da die falschen ergebnisse rauskommen.</p>
<pre><code class="language-cpp">// 
#include &lt;iostream&gt;
#include &lt;cmath&gt;
#include &lt;iomanip&gt;
#include &lt;string&gt;
#include &lt;sstream&gt;
#include &lt;fstream&gt;
using namespace std;
double det (double A[3][3])
{
	double D;
	D=A[0][0]*A[1][1]*A[2][2]+A[0][1]*A[1][2]*A[2][0]+A[0][2]*A[1][0]*A[2][1]-A[0][2]*A[1][1]*A[2][0]-A[0][0]*A[1][2]*A[2][1]-A[0][1]*A[1][0]*A[2][2];
	return D;
}
double keyfind(string schluessel,ifstream&amp; balken)
{

	string Zeile;
	istringstream iss;
	while (balken.eof())
	{
		while(getline(balken, Zeile));
		{			
			if (Zeile[0]==schluessel[0]  &amp;&amp; Zeile[1]==schluessel[1] &amp;&amp; Zeile[2]==schluessel[2])
			{
				Zeile.erase(0,3);
				double D;
				iss.str(Zeile);
				iss &gt;&gt; D;
				return D;
			}
		}
	}
}
double Di(int i, double A[3][3], double b[3])
{
	double A2[3][3];
	for (int j=0; j&lt;3; j++)
	{
		for (int k=0; k&lt;3; k++)
		{
			if (i==k)
				A2[j][k]=b[j];
			else
				A2[j][k]=A[j][k];
		}
	}
	return det(A2);
}
void lingl (double A[3][3],double b[3],double F[3])
{
	double D = det(A);
	for (int i=0; i&lt;3; i++)
	{		F[i]=Di(i, A, b)/D;
	}

}
void main (void)
{
	double l[4],delta[3],delta1[3],pi=3.14159,G,b[3],F[3],A[3][3];

	ifstream balken(&quot;Balken.dat&quot;);
	ofstream lager(&quot;Lager.dat&quot;);

	if (!balken)
	{
		cerr &lt;&lt; &quot;Es ist ein Fehler beim Oeffnen der Datei aufgetreten!&quot; &lt;&lt; endl;
	}
	else
	{
		G=keyfind(&quot;G: &quot;,balken);
		delta[0]=keyfind(&quot;D1:&quot;,balken);
		delta[1]=keyfind(&quot;D2:&quot;,balken);
		delta[2]=keyfind(&quot;D3:&quot;,balken);
		l[0]=keyfind(&quot;L1:&quot;,balken);
		l[1]=keyfind(&quot;L2:&quot;,balken);
		l[2]=keyfind(&quot;L3:&quot;,balken); 
		l[3]=keyfind(&quot;L4:&quot;,balken);

		delta1[0]=delta[0];
		delta1[1]=delta[1];
		delta1[2]=delta[2];

		for (int i=0;i&lt;3;i++)
		{
			delta[i]=delta[i]*pi/180;
		}
		for (int i=0;i&lt;3;i++)
		{
			A[0][i]=cos(delta[i]);
			A[1][i]=sin(delta[i]);
			A[2][i]=l[i]*A[1][i];
		}

		A[0][2]=-A[0][2];

		b[0]=0;
		b[1]=G;
		b[2]=G*l[3];

		lingl(A,b,F);	

		lager &lt;&lt; setprecision(1) &lt;&lt; fixed;
		for (int i = 0; i&lt;=3; i++)
			lager &lt;&lt; &quot;L&quot; &lt;&lt; i+1 &lt;&lt; &quot; = \t&quot; &lt;&lt; setw(8) &lt;&lt; l[i] &lt;&lt; &quot;\t&quot;;
			lager &lt;&lt; endl;
		for (int i = 0; i&lt;=2; i++)
			lager &lt;&lt; &quot;D&quot; &lt;&lt; i+1 &lt;&lt; &quot; = \t&quot; &lt;&lt; setw(8) &lt;&lt; delta1[i] &lt;&lt; &quot;\t&quot;;
			lager &lt;&lt; endl &lt;&lt; &quot;G  = \t&quot; &lt;&lt; setw(8) &lt;&lt; G &lt;&lt; endl;
		for (int i = 0; i&lt;=2; i++)
			lager &lt;&lt; &quot;F&quot; &lt;&lt; i+1 &lt;&lt; &quot; = \t&quot; &lt;&lt; setw(8) &lt;&lt; F[i] &lt;&lt; &quot;\t&quot;;
		}

	balken.close();
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1527213</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1527213</guid><dc:creator><![CDATA[sp.ChefKoch]]></dc:creator><pubDate>Wed, 11 Jun 2008 18:00:51 GMT</pubDate></item><item><title><![CDATA[Reply to error C2248, streamcode macht mucken on Wed, 11 Jun 2008 17:51:51 GMT]]></title><description><![CDATA[<p>sp.ChefKoch schrieb:</p>
<blockquote>
<pre><code>void main (void)
</code></pre>
</blockquote>
<p>Ist ja nett, wie du unsere Vorschläge beachtest. Denkst du, das fördert unsere Hilfsbereitschaft? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
<p>Und im Übrigen würde ich dir dringend zu C/C++- und nicht Code-Tags raten. Editier doch deinen Beitrag dementsprechend.</p>
<p>Und was soll diese Art? 115 Zeilen Code zu posten und zu sagen: Ihr könnt mal den Fehler suchen, irgendwas stimmt nicht. Was erwartest du eigentlich?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1527216</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1527216</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Wed, 11 Jun 2008 17:51:51 GMT</pubDate></item><item><title><![CDATA[Reply to error C2248, streamcode macht mucken on Wed, 11 Jun 2008 18:12:12 GMT]]></title><description><![CDATA[<p>Ich erwarte garnichts, oder hab ich im letzten Beitrag was davon geschrieben, dass ihr den Fehler suchen oder mir dabei helfen sollt!?</p>
<p>Und wenns dich nich interessiert brauchst du's ja nicht durchzulesen.</p>
<p>Die Sache mit</p>
<pre><code class="language-cpp">void main (void)
</code></pre>
<p>hat übrigens unser Prof vorgegeben.<br />
Mag sein, dass das Quatsch ist, aber er will's so haben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1527227</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1527227</guid><dc:creator><![CDATA[sp.ChefKoch]]></dc:creator><pubDate>Wed, 11 Jun 2008 18:12:12 GMT</pubDate></item><item><title><![CDATA[Reply to error C2248, streamcode macht mucken on Wed, 11 Jun 2008 18:23:52 GMT]]></title><description><![CDATA[<p>sp.ChefKoch schrieb:</p>
<blockquote>
<p>Mag sein, dass das Quatsch ist, aber er will's so haben.</p>
</blockquote>
<p>Du meinst, er hat was dagegen, korrigiert zu werden?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1527232</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1527232</guid><dc:creator><![CDATA[camper]]></dc:creator><pubDate>Wed, 11 Jun 2008 18:23:52 GMT</pubDate></item><item><title><![CDATA[Reply to error C2248, streamcode macht mucken on Wed, 11 Jun 2008 18:26:45 GMT]]></title><description><![CDATA[<p>Keine Ahnung, aber ich schätz ihn eigentlich so ein dass ihm bewusst ist was er da schreibt.<br />
Und es ändert ja nichts an der Funktion des Programmes - jedenfalls nichts was mir auffällt ^^</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1527233</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1527233</guid><dc:creator><![CDATA[sp.ChefKoch]]></dc:creator><pubDate>Wed, 11 Jun 2008 18:26:45 GMT</pubDate></item><item><title><![CDATA[Reply to error C2248, streamcode macht mucken on Wed, 11 Jun 2008 18:30:21 GMT]]></title><description><![CDATA[<p>sp.ChefKoch schrieb:</p>
<blockquote>
<p>Keine Ahnung, aber ich schätz ihn eigentlich so ein dass ihm bewusst ist was er da schreibt.</p>
</blockquote>
<p>Mag sein, aber dann hat er seit &gt;10 Jahren kein C++ Buch mehr gelesen. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1527235</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1527235</guid><dc:creator><![CDATA[drakon]]></dc:creator><pubDate>Wed, 11 Jun 2008 18:30:21 GMT</pubDate></item><item><title><![CDATA[Reply to error C2248, streamcode macht mucken on Wed, 11 Jun 2008 18:31:50 GMT]]></title><description><![CDATA[<p>Ich werds ihm ausrichten ^^</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1527237</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1527237</guid><dc:creator><![CDATA[sp.ChefKoch]]></dc:creator><pubDate>Wed, 11 Jun 2008 18:31:50 GMT</pubDate></item><item><title><![CDATA[Reply to error C2248, streamcode macht mucken on Wed, 11 Jun 2008 18:57:51 GMT]]></title><description><![CDATA[<p>sp.ChefKoch schrieb:</p>
<blockquote>
<p>Ich erwarte garnichts, oder hab ich im letzten Beitrag was davon geschrieben, dass ihr den Fehler suchen oder mir dabei helfen sollt!?</p>
</blockquote>
<p>sp.ChefKoch schrieb:</p>
<blockquote>
<p>hier mal das ganze programm, falls es jemanden interessiert.<br />
allerdings ist noch irgendwo ein fehler, da die falschen ergebnisse rauskommen.</p>
</blockquote>
<p>Ich behaupte mal, das kommt einer Aufforderung, die Fehler durchzusuchen, ziemlich nahe.</p>
<p>sp.ChefKoch schrieb:</p>
<blockquote>
<p>Und wenns dich nich interessiert brauchst du's ja nicht durchzulesen.</p>
</blockquote>
<p>Hab ich auch nicht getan, aber nicht weils mich nicht interessiert hat. Ich mag erstens Mangel von Eigeninitiative und zweitens die Ignorierung der Vorschläge von anderen Usern nicht. Ich wollte es nur mal sagen, möglicherweise haben wir uns falsch verstanden.</p>
<p>sp.ChefKoch schrieb:</p>
<blockquote>
<p>Und es ändert ja nichts an der Funktion des Programmes - jedenfalls nichts was mir auffällt ^^</p>
</blockquote>
<p>Du hast einfach Glück, dass dein Compiler keine Fehlermeldung ausgibt. Standardkonform ist es deswegen noch lange nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1527253</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1527253</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Wed, 11 Jun 2008 18:57:51 GMT</pubDate></item></channel></rss>