<?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[Korrektur eines Scripts]]></title><description><![CDATA[<p>// Beispiel für struct<br />
// Dieter Haß bearbeitet von Maximilian Hille<br />
// 17.11.2006</p>
<p>#include &lt;cstdlib&gt;<br />
#include &lt;iostream&gt;<br />
using namespace std;</p>
<p>int main() {<br />
struct mensch {<br />
char* vorname;<br />
char* nachname;<br />
int alter;<br />
int koerpergroesse;</p>
<p>};<br />
mensch ich, du;</p>
<p>cout &lt;&lt; &quot;Bitte in Reihenfolge aufschreiben: Vorname, Nachname, Alter und Körpergroesse in cm: &quot; &lt;&lt; endl;<br />
cin &gt;&gt; ich.vorname;<br />
cin &gt;&gt; ich.nachname;<br />
cin &gt;&gt; ich.alter;<br />
cin &gt;&gt; ich.koerpergroesse;<br />
du = ich;<br />
cout &lt;&lt; du.nachname &lt;&lt; &quot;, &quot; &lt;&lt; du.vorname &lt;&lt; &quot; Alter: &quot; &lt;&lt; du.alter &lt;&lt; du.koerpergroesse &lt;&lt; endl;<br />
system(&quot;PAUSE&quot;);<br />
return EXIT_SUCCESS;<br />
}</p>
<p>haben wir in informatik un keiner weiß wies richtig ist, hilfe wäre nett :xmas1:</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/167849/korrektur-eines-scripts</link><generator>RSS for Node</generator><lastBuildDate>Wed, 16 Sep 2026 05:05:37 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/167849.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 15 Dec 2006 15:38:47 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Korrektur eines Scripts on Fri, 15 Dec 2006 15:38:47 GMT]]></title><description><![CDATA[<p>// Beispiel für struct<br />
// Dieter Haß bearbeitet von Maximilian Hille<br />
// 17.11.2006</p>
<p>#include &lt;cstdlib&gt;<br />
#include &lt;iostream&gt;<br />
using namespace std;</p>
<p>int main() {<br />
struct mensch {<br />
char* vorname;<br />
char* nachname;<br />
int alter;<br />
int koerpergroesse;</p>
<p>};<br />
mensch ich, du;</p>
<p>cout &lt;&lt; &quot;Bitte in Reihenfolge aufschreiben: Vorname, Nachname, Alter und Körpergroesse in cm: &quot; &lt;&lt; endl;<br />
cin &gt;&gt; ich.vorname;<br />
cin &gt;&gt; ich.nachname;<br />
cin &gt;&gt; ich.alter;<br />
cin &gt;&gt; ich.koerpergroesse;<br />
du = ich;<br />
cout &lt;&lt; du.nachname &lt;&lt; &quot;, &quot; &lt;&lt; du.vorname &lt;&lt; &quot; Alter: &quot; &lt;&lt; du.alter &lt;&lt; du.koerpergroesse &lt;&lt; endl;<br />
system(&quot;PAUSE&quot;);<br />
return EXIT_SUCCESS;<br />
}</p>
<p>haben wir in informatik un keiner weiß wies richtig ist, hilfe wäre nett :xmas1:</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1192540</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1192540</guid><dc:creator><![CDATA[rangernr15]]></dc:creator><pubDate>Fri, 15 Dec 2006 15:38:47 GMT</pubDate></item><item><title><![CDATA[Reply to Korrektur eines Scripts on Fri, 15 Dec 2006 15:45:07 GMT]]></title><description><![CDATA[<p>Hör auf deinen Compiler.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1192543</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1192543</guid><dc:creator><![CDATA[Michael E.]]></dc:creator><pubDate>Fri, 15 Dec 2006 15:45:07 GMT</pubDate></item><item><title><![CDATA[Reply to Korrektur eines Scripts on Fri, 15 Dec 2006 15:50:04 GMT]]></title><description><![CDATA[<p>fehlt noch ein #include &lt;ostream&gt; oder?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1192547</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1192547</guid><dc:creator><![CDATA[camper]]></dc:creator><pubDate>Fri, 15 Dec 2006 15:50:04 GMT</pubDate></item><item><title><![CDATA[Reply to Korrektur eines Scripts on Fri, 15 Dec 2006 15:56:59 GMT]]></title><description><![CDATA[<p>Nope, denn iostream erbt virtuell von ostream.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1192553</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1192553</guid><dc:creator><![CDATA[Michael E.]]></dc:creator><pubDate>Fri, 15 Dec 2006 15:56:59 GMT</pubDate></item><item><title><![CDATA[Reply to Korrektur eines Scripts on Fri, 15 Dec 2006 16:04:13 GMT]]></title><description><![CDATA[<p>Michael E. schrieb:</p>
<blockquote>
<p>Nope, denn iostream erbt virtuell von ostream.</p>
</blockquote>
<p>seit wann können header erben und was soll man darunter verstehen?</p>
<p>P.S. schau mal nach, wo std::endl deklariert wird.</p>
<p>natürlich ist das nicht das eigentliche problem - aber irgendwie hab ich keine lust auf char* und strings und den ganzen kram einzugehen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1192554</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1192554</guid><dc:creator><![CDATA[camper]]></dc:creator><pubDate>Fri, 15 Dec 2006 16:04:13 GMT</pubDate></item><item><title><![CDATA[Reply to Korrektur eines Scripts on Fri, 15 Dec 2006 16:48:41 GMT]]></title><description><![CDATA[<p>Das hier:</p>
<pre><code class="language-cpp">cin &gt;&gt; ich.vorname;
</code></pre>
<p>kann nicht funktionieren, weil vorname ein char * ist. cin &gt;&gt; in Kombination mit char * oder char[] ist ansich schon eine extrem dumme Idee. Aber der char * zeigt in diesem Fall außerdem noch nirgendwo hin.</p>
<p>vorname sollte eigentlich vom Typ std::string sein.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1192587</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1192587</guid><dc:creator><![CDATA[Z2]]></dc:creator><pubDate>Fri, 15 Dec 2006 16:48:41 GMT</pubDate></item><item><title><![CDATA[Reply to Korrektur eines Scripts on Fri, 15 Dec 2006 17:31:31 GMT]]></title><description><![CDATA[<p>[Edit] Kompletter Unfug, den ich geschrieben hab.</p>
<p>Ich hatte in Erinnerung, dass es eine Klasse iostream gibt, die von istream und ostream erbt und in iostream definiert wird.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1192603</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1192603</guid><dc:creator><![CDATA[Michael E.]]></dc:creator><pubDate>Fri, 15 Dec 2006 17:31:31 GMT</pubDate></item><item><title><![CDATA[Reply to Korrektur eines Scripts on Fri, 15 Dec 2006 17:34:50 GMT]]></title><description><![CDATA[<p>Hm,</p>
<p>ich sehe keine Garantie das durch den iostream Header auch der ostream Header eingebunden ist. Die Implementierung des ostreams könnte auch in magic.h geschehen und iostream als auch ostream header beziehen sich nur auf magic.h .</p>
<p>Es sei denn natürlich, der Standard garantiert das durch includieren von iostream auch alles was in ostream steht bekannt gemacht wird.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1192610</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1192610</guid><dc:creator><![CDATA[Knuddlbaer]]></dc:creator><pubDate>Fri, 15 Dec 2006 17:34:50 GMT</pubDate></item><item><title><![CDATA[Reply to Korrektur eines Scripts on Fri, 15 Dec 2006 19:31:48 GMT]]></title><description><![CDATA[<p>In iostream werden unter anderem die Objekte cin und cout definiert.</p>
<ul>
<li>cin ist ein Objekt vom Typ istream</li>
<li>cout ist ein Objekt vom Typ ostream</li>
</ul>
<p>&lt;a href= schrieb:</p>
<blockquote>
<p>cppreference&quot;&gt;The &lt;iostream&gt; library automatically defines a few standard objects:</p>
<p>* cout, an object of the ostream class, which displays data to the standard output device.<br />
* cerr, another object of the ostream class that writes unbuffered output to the standard error device.<br />
* clog, like cerr, but uses buffered output.<br />
* cin, an object of the istream class that reads data from the standard input device.</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/1192648</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1192648</guid><dc:creator><![CDATA[schorsch code]]></dc:creator><pubDate>Fri, 15 Dec 2006 19:31:48 GMT</pubDate></item><item><title><![CDATA[Reply to Korrektur eines Scripts on Sat, 16 Dec 2006 10:05:39 GMT]]></title><description><![CDATA[<p>Dann ist <a href="http://cppreference.com" rel="nofollow">cppreference.com</a> fehlerhaft, denn der Standard sagt:</p>
<p>27.3.1 schrieb:</p>
<blockquote>
<p>The header <code>&lt;iostream&gt;</code> declares objects that associate objects with the standard C streams provided for by the functions declared in <code>&lt;cstdio&gt;</code> (27.8.2).</p>
</blockquote>
<p>Somit braucht <code>&lt;iostream&gt;</code> auch nur die Deklarationen von <code>ostream</code> und <code>istream</code> .</p>
<p>[Edit] Oder? *gradverunsichert*</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1192852</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1192852</guid><dc:creator><![CDATA[Michael E.]]></dc:creator><pubDate>Sat, 16 Dec 2006 10:05:39 GMT</pubDate></item><item><title><![CDATA[Reply to Korrektur eines Scripts on Sat, 16 Dec 2006 16:52:30 GMT]]></title><description><![CDATA[<p>Michael E. schrieb:</p>
<blockquote>
<p>Dann ist <a href="http://cppreference.com" rel="nofollow">cppreference.com</a> fehlerhaft, denn der Standard sagt:</p>
<p>27.3.1 schrieb:</p>
<blockquote>
<p>The header <code>&lt;iostream&gt;</code> declares objects that associate objects with the standard C streams provided for by the functions declared in <code>&lt;cstdio&gt;</code> (27.8.2).</p>
</blockquote>
<p>Somit braucht <code>&lt;iostream&gt;</code> auch nur die Deklarationen von <code>ostream</code> und <code>istream</code> .</p>
<p>[Edit] Oder? *gradverunsichert*</p>
</blockquote>
<p>richtig, &lt;iostream&gt; könnte so aussehen:</p>
<pre><code class="language-cpp">namespace std
{
template&lt;&gt; struct char_traits;
template &lt;class charT, class traits = char_traits&lt;charT&gt; &gt; class basic_istream;
template &lt;class charT, class traits = char_traits&lt;charT&gt; &gt; class basic_ostream;
typedef basic_istream&lt;char&gt; istream;
typedef basic_ostream&lt;char&gt; ostream;
typedef basic_istream&lt;wchar_t&gt; wistream;
typedef basic_ostream&lt;wchar_t&gt; wostream;
extern istream cin;
extern ostream cout;
extern ostream cerr;
extern ostream clog;
extern wistream wcin;
extern wostream wcout;
extern wostream wcerr;
extern wostream wclog;
}
</code></pre>
<p>wichtig ist, dass die objekte nur deklariert und <em>nicht</em> definiert werden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1193018</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1193018</guid><dc:creator><![CDATA[camper]]></dc:creator><pubDate>Sat, 16 Dec 2006 16:52:30 GMT</pubDate></item></channel></rss>