<?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[Problem mit time]]></title><description><![CDATA[<p>Hi leute<br />
ich habe folgendes programm geschrieben:</p>
<pre><code>#include &quot;stdafx.h&quot;
#include &lt;iostream&gt;
#include &lt;ctime&gt;
using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
	time_t start;
	double dauer = 5;
	if ((difftime(time(NULL), start))&gt;dauer){
		cout &lt;&lt; &quot;5 secunden vergangen&quot;;
		system(&quot;Pause&quot;);
	}
	else {
		cout &lt;&lt;&quot;Fehlgeschlagen&quot;;
		system (&quot;Pause&quot;);
	}
	return 0;
}
</code></pre>
<p>Da kommt dann bei mir folgende warnung:</p>
<p>Kompilieren...<br />
time.cpp<br />
c:\dokumente und einstellungen\albert\eigene dateien\programmieren\time\time\time.cpp(13) : warning C4700: Die nicht initialisierte lokale Variable &quot;start&quot; wurde verwendet.</p>
<p>Wenn ich mein programm dann starten will erscheind dies:<br />
Fehlgeschlagen Taste drücken...</p>
<p>kann mir jmd sagen was ich falsch mache</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/174249/problem-mit-time</link><generator>RSS for Node</generator><lastBuildDate>Fri, 18 Sep 2026 14:41:57 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/174249.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 24 Feb 2007 15:17:24 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problem mit time on Sat, 24 Feb 2007 15:17:24 GMT]]></title><description><![CDATA[<p>Hi leute<br />
ich habe folgendes programm geschrieben:</p>
<pre><code>#include &quot;stdafx.h&quot;
#include &lt;iostream&gt;
#include &lt;ctime&gt;
using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
	time_t start;
	double dauer = 5;
	if ((difftime(time(NULL), start))&gt;dauer){
		cout &lt;&lt; &quot;5 secunden vergangen&quot;;
		system(&quot;Pause&quot;);
	}
	else {
		cout &lt;&lt;&quot;Fehlgeschlagen&quot;;
		system (&quot;Pause&quot;);
	}
	return 0;
}
</code></pre>
<p>Da kommt dann bei mir folgende warnung:</p>
<p>Kompilieren...<br />
time.cpp<br />
c:\dokumente und einstellungen\albert\eigene dateien\programmieren\time\time\time.cpp(13) : warning C4700: Die nicht initialisierte lokale Variable &quot;start&quot; wurde verwendet.</p>
<p>Wenn ich mein programm dann starten will erscheind dies:<br />
Fehlgeschlagen Taste drücken...</p>
<p>kann mir jmd sagen was ich falsch mache</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1234683</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1234683</guid><dc:creator><![CDATA[albertk13]]></dc:creator><pubDate>Sat, 24 Feb 2007 15:17:24 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit time on Sat, 24 Feb 2007 15:25:43 GMT]]></title><description><![CDATA[<p>Ja ganz einfach ... also ... er soll ja die Differenz von der aktuellen Zeit(also time()) und deiner Zeitvariable start errechnen ... in Sekunden ... so, wenn du aber für start garkeinen Wert angibst, kann er da ja auch schlecht eine Differenz bilden ...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1234688</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1234688</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Sat, 24 Feb 2007 15:25:43 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit time on Sat, 24 Feb 2007 15:47:36 GMT]]></title><description><![CDATA[<p>aja danke<br />
warum beendet jetzt aber mein programm nicht nach 20 sek?:</p>
<pre><code>int main()
{
	time_t start(NULL);
	double dauer = 20;
...
    while((difftime(time(NULL), start))&gt;dauer)
    {
...
    }
	exit (1);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1234694</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1234694</guid><dc:creator><![CDATA[albertk13]]></dc:creator><pubDate>Sat, 24 Feb 2007 15:47:36 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit time on Sat, 24 Feb 2007 16:17:24 GMT]]></title><description><![CDATA[<p>versuch es einfach so</p>
<pre><code>#include &lt;time.h&gt;
int main()
{
    time_t start= time(0);
    double dauer = 20;
    while((difftime(time(0), start))&lt;dauer);
    return 0;
}
</code></pre>
<p>Kurt</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1234721</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1234721</guid><dc:creator><![CDATA[ZuK]]></dc:creator><pubDate>Sat, 24 Feb 2007 16:17:24 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit time on Sat, 24 Feb 2007 16:36:23 GMT]]></title><description><![CDATA[<p>danke es funktioniert</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1234728</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1234728</guid><dc:creator><![CDATA[albertk13]]></dc:creator><pubDate>Sat, 24 Feb 2007 16:36:23 GMT</pubDate></item></channel></rss>