<?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[[gelöst] Fehler bei enum in struct]]></title><description><![CDATA[<p>Hallo Zusammen<br />
Ich bin neu in C++ und in diesem Forum.</p>
<p>Bei Erstellen eines Programm das zur Erfassung von Personalien und Adresse dienen soll. Gibt der Compiler einen Fehler aus und bricht ab. Das Problem stellt eine Enumeration dar auf welche eine Struktur zurück greift.</p>
<pre><code>#include &lt;iostream&gt; 
#include &lt;string&gt;

enum land 
{ 
  Deutschland, Oesterreich, Schweiz 
}; 
struct adresse
{
  land Land; 
};
int main()
{
  adresse Adresse;
  std::cout &lt;&lt; &quot;Land: &quot; &lt;&lt; std::flush;
  std::cin &gt;&gt; Adresse.Land;
}
</code></pre>
<p>Trotz Google-Suche, habe ich keine Idee mehr wo der Fehler sein könnte.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/321242/gelöst-fehler-bei-enum-in-struct</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Jul 2026 20:41:34 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/321242.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 29 Oct 2013 13:13:50 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [gelöst] Fehler bei enum in struct on Tue, 29 Oct 2013 15:47:02 GMT]]></title><description><![CDATA[<p>Hallo Zusammen<br />
Ich bin neu in C++ und in diesem Forum.</p>
<p>Bei Erstellen eines Programm das zur Erfassung von Personalien und Adresse dienen soll. Gibt der Compiler einen Fehler aus und bricht ab. Das Problem stellt eine Enumeration dar auf welche eine Struktur zurück greift.</p>
<pre><code>#include &lt;iostream&gt; 
#include &lt;string&gt;

enum land 
{ 
  Deutschland, Oesterreich, Schweiz 
}; 
struct adresse
{
  land Land; 
};
int main()
{
  adresse Adresse;
  std::cout &lt;&lt; &quot;Land: &quot; &lt;&lt; std::flush;
  std::cin &gt;&gt; Adresse.Land;
}
</code></pre>
<p>Trotz Google-Suche, habe ich keine Idee mehr wo der Fehler sein könnte.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2363687</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2363687</guid><dc:creator><![CDATA[housyharry]]></dc:creator><pubDate>Tue, 29 Oct 2013 15:47:02 GMT</pubDate></item><item><title><![CDATA[Reply to [gelöst] Fehler bei enum in struct on Tue, 29 Oct 2013 13:23:37 GMT]]></title><description><![CDATA[<p>housyharry schrieb:</p>
<blockquote>
<p>Trotz Google-Suche, habe ich keine Idee mehr wo der Fehler sein könnte.</p>
</blockquote>
<p>Trotz Posting-Suche, habe ich keine Idee mehr wo die Fehlermeldung sein könnte.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2363690</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2363690</guid><dc:creator><![CDATA[daddy_felix]]></dc:creator><pubDate>Tue, 29 Oct 2013 13:23:37 GMT</pubDate></item><item><title><![CDATA[Reply to [gelöst] Fehler bei enum in struct on Tue, 29 Oct 2013 13:30:12 GMT]]></title><description><![CDATA[<pre><code>...
In file included from /usr/include/c++/4.8/string:53:0,
                 from /usr/include/c++/4.8/bits/locale_classes.h:40,
                 from /usr/include/c++/4.8/bits/ios_base.h:41,
                 from /usr/include/c++/4.8/ios:42,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from test.cpp:1:
/usr/include/c++/4.8/bits/basic_string.tcc:996:5: note: template&lt;class _CharT, class _Traits, class _Alloc&gt; std::basic_istream&lt;_CharT, _Traits&gt;&amp; std::operator&gt;&gt;(std::basic_istream&lt;_CharT, _Traits&gt;&amp;, std::basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp;)
     operator&gt;&gt;(basic_istream&lt;_CharT, _Traits&gt;&amp; __in,
     ^
/usr/include/c++/4.8/bits/basic_string.tcc:996:5: note:   template argument deduction/substitution failed:
test.cpp:16:23: note:   mismatched types ‘std::basic_string&lt;_CharT, _Traits, _Alloc&gt;’ and ‘land’
   std::cin &gt;&gt; Adresse.Land;
                       ^
</code></pre>
<p>Reicht das? oder braucht es die ganze Fehlermeldung?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2363691</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2363691</guid><dc:creator><![CDATA[housyharry]]></dc:creator><pubDate>Tue, 29 Oct 2013 13:30:12 GMT</pubDate></item><item><title><![CDATA[Reply to [gelöst] Fehler bei enum in struct on Tue, 29 Oct 2013 13:43:42 GMT]]></title><description><![CDATA[<p>Es gibt keine vordefinierte Eingabefunktion für enum-Typen. Wie sollte diese deiner Meinung nach aussehen? Wie auch immer deine Antwort lautet: Das musst du dann selber programmieren.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2363694</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2363694</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Tue, 29 Oct 2013 13:43:42 GMT</pubDate></item><item><title><![CDATA[Reply to [gelöst] Fehler bei enum in struct on Tue, 29 Oct 2013 15:11:03 GMT]]></title><description><![CDATA[<p>OK, ich glaube langsam blicke ich durch.<br />
Ich habe es folgendermassen gelöst:</p>
<pre><code>#include &lt;iostream&gt; 
#include &lt;string&gt;

enum land 
{ 
  Deutschland, Oesterreich, Schweiz 
}; 
struct adresse
{
  land Land; 
};
int main()
{
  adresse Adresse;
  int Land;
  std::cout &lt;&lt; &quot;Land 0(Deutschland), 1 (Östereich), 2 (Schweiz): &quot; &lt;&lt; std::flush;
  std::cin &gt;&gt; Land;
  Adresse.Land = static_cast&lt;land&gt;(Land);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2363707</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2363707</guid><dc:creator><![CDATA[housyharry]]></dc:creator><pubDate>Tue, 29 Oct 2013 15:11:03 GMT</pubDate></item><item><title><![CDATA[Reply to [gelöst] Fehler bei enum in struct on Tue, 29 Oct 2013 15:34:22 GMT]]></title><description><![CDATA[<p>Ja, so geht das.</p>
<p>Die Streams haben übrigens ein wenig bekanntes Feature, dass man zwei Streams zusammenbinden kann, so dass Ausgabeoperationen auf einem Stream automatisch geflushed werden, bevor eine Eingabeoperation auf dem anderen statt findet. cin und cout sind bereits auf diese Weise verbunden. Das heißt, das flush am Ende deiner Ausgabe kannst du dir sparen, ohne zu befürchten, dass die Eingabeaufforderung nicht rechtzeitig erscheint.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2363708</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2363708</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Tue, 29 Oct 2013 15:34:22 GMT</pubDate></item><item><title><![CDATA[Reply to [gelöst] Fehler bei enum in struct on Tue, 29 Oct 2013 15:46:27 GMT]]></title><description><![CDATA[<p>Danke, das ist hilfreich.</p>
<p>Setze den Thread auf gelöst.<br />
Wobei ich später bestimmt elegantere Lösungen finden werde.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2363709</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2363709</guid><dc:creator><![CDATA[housyharry]]></dc:creator><pubDate>Tue, 29 Oct 2013 15:46:27 GMT</pubDate></item></channel></rss>