<?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[Timer Programm Hilfe]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich bin noch Anfänger in C++ und möchte einen Timer programmieren, der bei 0:0:0 (Stunden, Minuten, Sekunden) anfängt hochzuzählen.</p>
<p>Das Problem ist, wenn das Programm startet, wird &quot;0:0:0&quot; ausgegeben, aber er zählt nicht hoch.</p>
<p>Hier mein Code:</p>
<pre><code class="language-cpp">void Timer()
{
	std::cout&lt;&lt;'\n'&lt;&lt;h&lt;&lt;':'&lt;&lt;m&lt;&lt;':'&lt;&lt;s;

	while(true)
	{		
		if(s&gt;=59)
		{
			m++;
			s=0;
		}
		else if(m&gt;=59 &amp;&amp; s&gt;=59)
		{
			h++;
			m=0;
		}

		s++;

		Sleep(1000);		
	}
}
</code></pre>
<p>Könnt ihr mir da helfen, ich weiß wirklich nicht mehr weiter...</p>
<p>Gruß</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/302065/timer-programm-hilfe</link><generator>RSS for Node</generator><lastBuildDate>Tue, 11 Aug 2026 14:06:48 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/302065.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 10 Apr 2012 16:04:22 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Timer Programm Hilfe on Tue, 10 Apr 2012 16:04:22 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich bin noch Anfänger in C++ und möchte einen Timer programmieren, der bei 0:0:0 (Stunden, Minuten, Sekunden) anfängt hochzuzählen.</p>
<p>Das Problem ist, wenn das Programm startet, wird &quot;0:0:0&quot; ausgegeben, aber er zählt nicht hoch.</p>
<p>Hier mein Code:</p>
<pre><code class="language-cpp">void Timer()
{
	std::cout&lt;&lt;'\n'&lt;&lt;h&lt;&lt;':'&lt;&lt;m&lt;&lt;':'&lt;&lt;s;

	while(true)
	{		
		if(s&gt;=59)
		{
			m++;
			s=0;
		}
		else if(m&gt;=59 &amp;&amp; s&gt;=59)
		{
			h++;
			m=0;
		}

		s++;

		Sleep(1000);		
	}
}
</code></pre>
<p>Könnt ihr mir da helfen, ich weiß wirklich nicht mehr weiter...</p>
<p>Gruß</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2200522</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2200522</guid><dc:creator><![CDATA[Timer Problem]]></dc:creator><pubDate>Tue, 10 Apr 2012 16:04:22 GMT</pubDate></item><item><title><![CDATA[Reply to Timer Programm Hilfe on Tue, 10 Apr 2012 16:13:14 GMT]]></title><description><![CDATA[<p>Beschreibe mal genau, was dein Problem ist. An sich sehe ich nichts großartig falsches an deinem Code, außer, dass du einen sehr merkwürdigen Effekt bekommen wirst, wenn die Minuten überlaufen. Und du gibst natürlich überhaupt nichts aus, d.h. dein Programm zählt zwar, aber das sieht man gar nicht. Ist dies dein Problem? Lies dir bitte mal den ersten Link in meiner Signatur durch, da findest du Tipps, wie man möglichst gute Fragen stellt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2200524</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2200524</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Tue, 10 Apr 2012 16:13:14 GMT</pubDate></item><item><title><![CDATA[Reply to Timer Programm Hilfe on Tue, 10 Apr 2012 16:19:46 GMT]]></title><description><![CDATA[<p>Danke für die Hilfe, ohne dich wäre ich nie draufgekommen, dass ich std::cout in die Schleife packen muss(peinlich, ich weiß ^^)</p>
<p>Den Effekt, der auftritt, wenn die Minuten hochzählen werde ich selbst herausfinden.</p>
<p>Gruß</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2200526</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2200526</guid><dc:creator><![CDATA[Timer Problem]]></dc:creator><pubDate>Tue, 10 Apr 2012 16:19:46 GMT</pubDate></item></channel></rss>