<?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[bermuda Spiel c++]]></title><description><![CDATA[<p>Könnte mir jemand vllt. sagen wo hier der Fehler ist:</p>
<pre><code>#include &lt;iostream&gt;

using namespace std;

const int X=9;
const int Y=7;

int main ()
{
	char Spielfeld [X] [Y];
	int x, y;
	char cx, cy;

	for (x=0; x&lt;X;x++)
	{
		for (y=0; y&lt;Y; y++)
		{
			Spielfeld [x] [y] = '.';
		}
	}
	bool SchleifenEnde=false;
	int xin, yin;

	do
	{
		cout &lt;&lt; &quot;    1 2 3 4 5 6 7 8 9&quot;&lt;&lt; endl;
		for(y=0; y&lt;Y; y++)
		{
			cout &lt;&lt; (char)('A'+y) &lt;&lt; &quot;   &quot;;

			for (x=0; x&lt;X; x++)
			{
				cout &lt;&lt; &quot;   &quot;&lt;&lt;Spielfeld[x] [y];
			}
			cout &lt;&lt; endl;
		}
		cin &gt;&gt; cx &gt;&gt; cy;
		xin = cx - '1';
		yin = cy - 'A';

		if (xin&gt;=0 &amp;&amp; xin&lt;9 &amp;&amp; yin &gt;=0 &amp;&amp; yin&lt;7)
		{
			Spielfeld [xin][yin] = 'x';
		}
		else
		{
			SchleifenEnde=true;
		}
		while (!SchleifenEnde);
	}

	return 0;
}
</code></pre>
<p>Danke schonmal im vorraus für die Antworten.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/329938/bermuda-spiel-c</link><generator>RSS for Node</generator><lastBuildDate>Fri, 03 Jul 2026 18:51:31 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/329938.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 15 Dec 2014 09:35:50 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to bermuda Spiel c++ on Mon, 15 Dec 2014 09:35:50 GMT]]></title><description><![CDATA[<p>Könnte mir jemand vllt. sagen wo hier der Fehler ist:</p>
<pre><code>#include &lt;iostream&gt;

using namespace std;

const int X=9;
const int Y=7;

int main ()
{
	char Spielfeld [X] [Y];
	int x, y;
	char cx, cy;

	for (x=0; x&lt;X;x++)
	{
		for (y=0; y&lt;Y; y++)
		{
			Spielfeld [x] [y] = '.';
		}
	}
	bool SchleifenEnde=false;
	int xin, yin;

	do
	{
		cout &lt;&lt; &quot;    1 2 3 4 5 6 7 8 9&quot;&lt;&lt; endl;
		for(y=0; y&lt;Y; y++)
		{
			cout &lt;&lt; (char)('A'+y) &lt;&lt; &quot;   &quot;;

			for (x=0; x&lt;X; x++)
			{
				cout &lt;&lt; &quot;   &quot;&lt;&lt;Spielfeld[x] [y];
			}
			cout &lt;&lt; endl;
		}
		cin &gt;&gt; cx &gt;&gt; cy;
		xin = cx - '1';
		yin = cy - 'A';

		if (xin&gt;=0 &amp;&amp; xin&lt;9 &amp;&amp; yin &gt;=0 &amp;&amp; yin&lt;7)
		{
			Spielfeld [xin][yin] = 'x';
		}
		else
		{
			SchleifenEnde=true;
		}
		while (!SchleifenEnde);
	}

	return 0;
}
</code></pre>
<p>Danke schonmal im vorraus für die Antworten.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2432908</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2432908</guid><dc:creator><![CDATA[Sgaf]]></dc:creator><pubDate>Mon, 15 Dec 2014 09:35:50 GMT</pubDate></item><item><title><![CDATA[Reply to bermuda Spiel c++ on Mon, 15 Dec 2014 09:48:29 GMT]]></title><description><![CDATA[<p>Da</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2432912</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2432912</guid><dc:creator><![CDATA[manni66]]></dc:creator><pubDate>Mon, 15 Dec 2014 09:48:29 GMT</pubDate></item><item><title><![CDATA[Reply to bermuda Spiel c++ on Mon, 15 Dec 2014 09:51:55 GMT]]></title><description><![CDATA[<p>Zeile 49/50 sieht auf den ersten Blick falsch aus.</p>
<p>Zum Glück haste so ordentlich eingerückt, daß man es gleich sieht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2432914</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2432914</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Mon, 15 Dec 2014 09:51:55 GMT</pubDate></item><item><title><![CDATA[Reply to bermuda Spiel c++ on Mon, 15 Dec 2014 10:10:41 GMT]]></title><description><![CDATA[<p>ich habs</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2432915</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2432915</guid><dc:creator><![CDATA[Sgaf]]></dc:creator><pubDate>Mon, 15 Dec 2014 10:10:41 GMT</pubDate></item><item><title><![CDATA[Reply to bermuda Spiel c++ on Mon, 15 Dec 2014 11:35:50 GMT]]></title><description><![CDATA[<p>Ich versteh eine Sache nicht ganz, und zwar wie die Buchstaben (y Koordinate) zu stande kommen.</p>
<p>Ich weiss es hat was mit :</p>
<pre><code>for (y=0; y&lt;Y; y++)
 {
cout &lt;&lt; (char)('A'+y) &lt;&lt; &quot;   &quot;;
 }
</code></pre>
<p>Doch verstehen tuh ich das nicht ganz könnte das mir jmd vllt erklären?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2432938</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2432938</guid><dc:creator><![CDATA[Sgaf]]></dc:creator><pubDate>Mon, 15 Dec 2014 11:35:50 GMT</pubDate></item><item><title><![CDATA[Reply to bermuda Spiel c++ on Mon, 15 Dec 2014 15:24:35 GMT]]></title><description><![CDATA[<p>'A' = 65<br />
'B' = 66<br />
'C' = 67<br />
...</p>
<p>Google mal nach ASCII-Tabelle</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2432980</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2432980</guid><dc:creator><![CDATA[MichelRT]]></dc:creator><pubDate>Mon, 15 Dec 2014 15:24:35 GMT</pubDate></item><item><title><![CDATA[Reply to bermuda Spiel c++ on Mon, 15 Dec 2014 20:59:30 GMT]]></title><description><![CDATA[<blockquote>
<blockquote>
<p>&gt; Voraus &lt;&lt;&lt; ! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> *klugscheiß-modus aus*</p>
</blockquote>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/2433039</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2433039</guid><dc:creator><![CDATA[hardware]]></dc:creator><pubDate>Mon, 15 Dec 2014 20:59:30 GMT</pubDate></item><item><title><![CDATA[Reply to bermuda Spiel c++ on Tue, 16 Dec 2014 12:08:36 GMT]]></title><description><![CDATA[<p>eine sache ist mir unklar das wurde nicht in meinem buch erwähnt und zwar das</p>
<pre><code>(char)
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2433100</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2433100</guid><dc:creator><![CDATA[Sgaf]]></dc:creator><pubDate>Tue, 16 Dec 2014 12:08:36 GMT</pubDate></item><item><title><![CDATA[Reply to bermuda Spiel c++ on Tue, 16 Dec 2014 12:47:52 GMT]]></title><description><![CDATA[<p>Das ist ein (C-style) cast in einen char. <strong>Das bewirkt, dass ein Zeichen und keine Zahl ausgegeben wird.</strong><br />
Es wird also eine andere Funktion / ein anderer operator&lt;&lt; aufgerufen.<br />
Denn operator&lt;&lt; ist überladen für verschiedene Parametertypen.</p>
<p>Beispiel:</p>
<pre><code>void func (char c) { std::cout &lt;&lt; &quot;func (char)&quot;; }
void func (int i) { std::cout &lt;&lt; &quot;func (int)&quot;; }

int main()
{
    func (48); // ruft func(int) auf
    func ((char)48); // wandelt 48 von int zu char um (ruft also func(char) auf)
    func ('A'); // ruft func(char) auf
}
</code></pre>
<p>Weitere casts (eingeführt durch C++):<br />
static_cast &lt;ThemenverwandT&gt; (Var)<br />
const_cast &lt;T&gt; (Var)<br />
reinterpret_cast &lt;T*&gt; (&amp;Var)<br />
dynamic_cast &lt;T*&gt; (&amp;Var)</p>
<p>Das kommt vielleicht später. <strong>casts sind jetzt nicht das was man einem Anfänger als erstes zeigen sollte</strong>. Ich <strong>caste so gut wie nie</strong>.</p>
<p>EDIT: Überladung und Operatorüberladung kommt vermutlich auch irgendwo weiter hinten.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2433101</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2433101</guid><dc:creator><![CDATA[5cript]]></dc:creator><pubDate>Tue, 16 Dec 2014 12:47:52 GMT</pubDate></item></channel></rss>