<?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[Konsole beenden in c++]]></title><description><![CDATA[<p>Hallo.<br />
Ich habe einen Server geschrieben, der in einer Command box läuft.<br />
Nun will ich diesen auch beenden können, wenn ich strg+c drücke funktionierts, aber mein Programm wird dann ja nicht ordnungsgemäß beendet.<br />
Auch x drücken ist nicht so das wahre.<br />
Meine Frage lautet wie beende ich mein Programm am einfachsten.<br />
Oder gibt es auch eien möglichkeit, dass mein Programm strg+c erkennt und dann ordungsgemäß beendet?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/259204/konsole-beenden-in-c</link><generator>RSS for Node</generator><lastBuildDate>Tue, 08 Sep 2026 23:08:50 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/259204.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 20 Jan 2010 13:04:23 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Konsole beenden in c++ on Wed, 20 Jan 2010 13:04:23 GMT]]></title><description><![CDATA[<p>Hallo.<br />
Ich habe einen Server geschrieben, der in einer Command box läuft.<br />
Nun will ich diesen auch beenden können, wenn ich strg+c drücke funktionierts, aber mein Programm wird dann ja nicht ordnungsgemäß beendet.<br />
Auch x drücken ist nicht so das wahre.<br />
Meine Frage lautet wie beende ich mein Programm am einfachsten.<br />
Oder gibt es auch eien möglichkeit, dass mein Programm strg+c erkennt und dann ordungsgemäß beendet?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1841972</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1841972</guid><dc:creator><![CDATA[SocketMaster]]></dc:creator><pubDate>Wed, 20 Jan 2010 13:04:23 GMT</pubDate></item><item><title><![CDATA[Reply to Konsole beenden in c++ on Wed, 20 Jan 2010 13:06:55 GMT]]></title><description><![CDATA[<p>Strg + D sendet ein EOF. Aber das hat insgesamt nichts mit C++ zu tun. Fuer welches Betriebssystem soll es denn sein?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1841975</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1841975</guid><dc:creator><![CDATA[knivil]]></dc:creator><pubDate>Wed, 20 Jan 2010 13:06:55 GMT</pubDate></item><item><title><![CDATA[Reply to Konsole beenden in c++ on Wed, 20 Jan 2010 13:06:59 GMT]]></title><description><![CDATA[<p>Stichwort &quot;signal handler&quot;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1841976</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1841976</guid><dc:creator><![CDATA[Fellhuhn]]></dc:creator><pubDate>Wed, 20 Jan 2010 13:06:59 GMT</pubDate></item><item><title><![CDATA[Reply to Konsole beenden in c++ on Wed, 20 Jan 2010 13:08:23 GMT]]></title><description><![CDATA[<p>Es sollsowohl in windows als auch Linux laufen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1841978</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1841978</guid><dc:creator><![CDATA[SocketMaster]]></dc:creator><pubDate>Wed, 20 Jan 2010 13:08:23 GMT</pubDate></item><item><title><![CDATA[Reply to Konsole beenden in c++ on Wed, 20 Jan 2010 13:34:17 GMT]]></title><description><![CDATA[<p>Fellhuhn schrieb:</p>
<blockquote>
<p>Stichwort &quot;signal handler&quot;</p>
</blockquote>
<p>Sich selbst zu zitieren ist toll. Da ich nicht so schnell hintereinander hier schreiben darf, mach ich es mal ausführlicher:</p>
<pre><code class="language-cpp">#include &lt;csignal&gt;

// ...

int main(...){
  signal( SIGTERM, cleanUp );
}
</code></pre>
<p>wobei cleanUp deine Funktion ist.</p>
<p><a href="http://www.cppreference.com/wiki/c/other/signal" rel="nofollow">http://www.cppreference.com/wiki/c/other/signal</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1842000</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1842000</guid><dc:creator><![CDATA[Fellhuhn]]></dc:creator><pubDate>Wed, 20 Jan 2010 13:34:17 GMT</pubDate></item><item><title><![CDATA[Reply to Konsole beenden in c++ on Wed, 20 Jan 2010 13:35:39 GMT]]></title><description><![CDATA[<p>Fellhuhn schrieb:</p>
<blockquote>
<p>Fellhuhn schrieb:</p>
<blockquote>
<p>Stichwort &quot;signal handler&quot;</p>
</blockquote>
<p>Sich selbst zu zitieren ist toll. Da ich nicht so schnell hintereinander hier schreiben darf, mach ich es mal ausführlicher:</p>
<pre><code class="language-cpp">#include &lt;csignal&gt;

// ...

int main(...){
  signal( SIGTERM, cleanUp );
}
</code></pre>
<p>wobei cleanUp deine Funktion ist.</p>
<p><a href="http://www.cppreference.com/wiki/c/other/signal" rel="nofollow">http://www.cppreference.com/wiki/c/other/signal</a></p>
</blockquote>
<p>EDIT: Oder hier: <a href="http://www.justfuckinggoogleit.com/search.pl?q=signal+handler+c%2B%2B" rel="nofollow">http://www.justfuckinggoogleit.com/search.pl?q=signal+handler+c%2B%2B</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1842003</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1842003</guid><dc:creator><![CDATA[Fellhuhn]]></dc:creator><pubDate>Wed, 20 Jan 2010 13:35:39 GMT</pubDate></item><item><title><![CDATA[Reply to Konsole beenden in c++ on Wed, 20 Jan 2010 18:42:23 GMT]]></title><description><![CDATA[<p>Wenn deinen Server in einen eigenen Thread auslagern würdest, könnte deine Konsole ja auf Eingabe warten.</p>
<p>Wenn es nur um das Beenden geht wird das Programm halt beendet sobald du die Eingabe bestätigst, ansonsten könntest du diese Option ja auch verwenden Servereinstellungen vornehmen zu können.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1842177</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1842177</guid><dc:creator><![CDATA[Kahino]]></dc:creator><pubDate>Wed, 20 Jan 2010 18:42:23 GMT</pubDate></item></channel></rss>