<?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 beim ersten Passwort geschützten Prog.]]></title><description><![CDATA[<p>Hi zusammen!</p>
<p>ich bin ein ziehmlicher neuling in C++ (lerne es gerade in einer ausbildung) und habe ein fast schon peinliches simples Prog geschrieben was Zahlen Quadriert. Dieses Prog wollte ich dann noch mit einem Passwortschutz versehen was aber nicht so ganz klappt</p>
<pre><code class="language-cpp">/* Test.cpp */               
#include &lt;stdio.h&gt;           
#include &lt;string.h&gt;
#include &lt;stdlib.h&gt;          
#include &lt;iostream&gt;       
#include &lt;conio.h&gt;           
#include &lt;windows.h&gt;

using namespace std;

int x = 0;     

int main () {

string password;
  cout &lt;&lt; &quot;Dieses Program benoetigt ein Passwort: &quot;;
  getline (cin, password);

  if (password == &quot;hallo&quot;) (
               cout &lt;&lt; &quot;\n Willkommen in dem Programm!&quot; &lt;&lt;endl
               );

  else (
       cout &lt;&lt; &quot;\n Passwort falsch! Fuck off!\n Beende das Programm in 5 sekunden...&quot;
       );
       Sleep (5000);
       return 0;

       system(&quot;pause&gt;nul&quot;);
       return 0;

  cout &lt;&lt;&quot; ***********************************************&quot;;
  cout &lt;&lt;                   &quot;*                             &quot; &lt;&lt;endl ;
  cout &lt;&lt;&quot; *                                              *&quot; &lt;&lt;endl ;
  cout &lt;&lt;&quot; *                      's tool                 *&quot; &lt;&lt;endl ;
  cout &lt;&lt;&quot; *                      zum                     *&quot; &lt;&lt;endl ;
  cout &lt;&lt;&quot; *                   Quadrieren                 *&quot; &lt;&lt;endl ;
  cout &lt;&lt;&quot; *                     v.1.0                    *&quot; &lt;&lt;endl ;
  cout &lt;&lt;&quot; *                                              *&quot; &lt;&lt;endl ;
  cout &lt;&lt;&quot; ************************************************&quot; &lt;&lt;endl &lt;&lt;endl ;
  cout &lt;&lt;&quot; Willkommen !&quot; &lt;&lt;endl;
  cout &lt;&lt;&quot; Dies ist ein einfaches Programm um Ganze Zahlen zu Quadrieren.&quot; &lt;&lt;endl;
  cout &lt;&lt;&quot; Die Anzahl ihrer Rechnungen sind begrenzt auf 10.&quot; &lt;&lt;endl;
  cout &lt;&lt;&quot; Sie haben noch 10 Rechnungen offen inkl. dieser hier!&quot; &lt;&lt; endl &lt;&lt; endl;
  cout &lt;&lt;&quot; Die Anwendung ist die Bildung des Quadrats einer Zahl.&quot; &lt;&lt; endl ;
  cout &lt;&lt;&quot; Geben sie einen beliebigen Wert fuer x ein:&quot; &lt;&lt; endl ;
  cout &lt;&lt; &quot;x : &quot;;            
  cin &gt;&gt; x;                  
  cout &lt;&lt; &quot;x * x = &quot; &lt;&lt; x*x &lt;&lt; endl &lt;&lt; endl ; 
  cout &lt;&lt; &quot;Sie haben noch 9 Rechnungen offen inkl. dieser hier!&quot; &lt;&lt; endl &lt;&lt; endl;
  cout &lt;&lt;&quot; Die Anwedung ist die Bildung des Quadrates einer Zahl.&quot; &lt;&lt; endl ;
  cout &lt;&lt;&quot; Geben sie einen beliebigen Wert fuer x ein:&quot; &lt;&lt; endl ;
  cout &lt;&lt;&quot; x : &quot;;
  cin &gt;&gt; x;
  cout &lt;&lt; &quot;x * x = &quot; &lt;&lt; x*x &lt;&lt; endl &lt;&lt; endl;
  cout &lt;&lt; &quot;Sie haben noch 8 Rechnungen offen inkl. dieser hier!&quot; &lt;&lt; endl &lt;&lt; endl;
  cout &lt;&lt;&quot; Die Anwedung ist die Bildung des Quadrates einer Zahl.&quot; &lt;&lt; endl ;
  cout &lt;&lt;&quot; Geben sie einen beliebigen Wert fuer x ein:&quot; &lt;&lt; endl ;
  cout &lt;&lt;&quot; x : &quot;;
  cin &gt;&gt; x;
  cout &lt;&lt; &quot;x * x = &quot; &lt;&lt; x*x &lt;&lt; endl &lt;&lt; endl;
  cout &lt;&lt; &quot;Sie haben noch 7 Rechnungen offen inkl. dieser hier!&quot; &lt;&lt; endl &lt;&lt; endl;
  cout &lt;&lt;&quot; Die Anwedung ist die Bildung des Quadrates einer Zahl.&quot; &lt;&lt; endl ;
  cout &lt;&lt;&quot; Geben sie einen beliebigen Wert fuer x ein:&quot; &lt;&lt; endl ;
  cout &lt;&lt;&quot; x : &quot;;
  cin &gt;&gt; x;
  cout &lt;&lt; &quot;x * x = &quot; &lt;&lt; x*x &lt;&lt; endl &lt;&lt; endl;
  cout &lt;&lt; &quot;Sie haben noch 6 Rechnungen offen inkl. dieser hier!&quot; &lt;&lt; endl &lt;&lt; endl;
  cout &lt;&lt;&quot; Die Anwedung ist die Bildung des Quadrates einer Zahl.&quot; &lt;&lt; endl ;
  cout &lt;&lt;&quot; Geben sie einen beliebigen Wert fuer x ein:&quot; &lt;&lt; endl ;
  cout &lt;&lt;&quot; x : &quot;;
  cin &gt;&gt; x;
  cout &lt;&lt; &quot;x * x = &quot; &lt;&lt; x*x &lt;&lt; endl &lt;&lt; endl;
  cout &lt;&lt; &quot;Sie haben noch 5 Rechnungen offen inkl. dieser hier!&quot; &lt;&lt; endl &lt;&lt; endl;
  cout &lt;&lt;&quot; Die Anwedung ist die Bildung des Quadrates einer Zahl.&quot; &lt;&lt; endl ;
  cout &lt;&lt;&quot; Geben sie einen beliebigen Wert fuer x ein:&quot; &lt;&lt; endl ;
  cout &lt;&lt;&quot; x : &quot;;
  cin &gt;&gt; x;
  cout &lt;&lt; &quot;x * x = &quot; &lt;&lt; x*x &lt;&lt; endl &lt;&lt; endl;
  cout &lt;&lt; &quot;Sie haben noch 4 Rechnungen offen inkl. dieser hier!&quot; &lt;&lt; endl &lt;&lt; endl;
  cout &lt;&lt;&quot; Die Anwedung ist die Bildung des Quadrates einer Zahl.&quot; &lt;&lt; endl ;
  cout &lt;&lt;&quot; Geben sie einen beliebigen Wert fuer x ein:&quot; &lt;&lt; endl ;
  cout &lt;&lt;&quot; x : &quot;;
  cin &gt;&gt; x;
  cout &lt;&lt; &quot;x * x = &quot; &lt;&lt; x*x &lt;&lt; endl &lt;&lt; endl;
  cout &lt;&lt; &quot;Sie haben noch 3 Rechnungen offen inkl. dieser hier!&quot; &lt;&lt; endl &lt;&lt; endl;
  cout &lt;&lt;&quot; Die Anwedung ist die Bildung des Quadrates einer Zahl.&quot; &lt;&lt; endl ;
  cout &lt;&lt;&quot; Geben sie einen beliebigen Wert fuer x ein:&quot; &lt;&lt; endl ;
  cout &lt;&lt;&quot; x : &quot;;
  cin &gt;&gt; x;
  cout &lt;&lt; &quot;x * x = &quot; &lt;&lt; x*x &lt;&lt; endl &lt;&lt; endl;
  cout &lt;&lt; &quot;Sie haben noch 2 Rechnungen offen inkl. dieser hier!&quot; &lt;&lt; endl &lt;&lt; endl;
  cout &lt;&lt;&quot; Die Anwedung ist die Bildung des Quadrates einer Zahl.&quot; &lt;&lt; endl ;
  cout &lt;&lt;&quot; Geben sie einen beliebigen Wert fuer x ein:&quot; &lt;&lt; endl ;
  cout &lt;&lt;&quot; x : &quot;;
  cin &gt;&gt; x;
  cout &lt;&lt; &quot;x * x = &quot; &lt;&lt; x*x &lt;&lt; endl &lt;&lt; endl;
  cout &lt;&lt; &quot;Sie haben noch 1 Rechnungen offen inkl. dieser hier!&quot; &lt;&lt; endl &lt;&lt; endl;
  cout &lt;&lt;&quot; Die Anwedung ist die Bildung des Quadrates einer Zahl.&quot; &lt;&lt; endl ;
  cout &lt;&lt;&quot; Geben sie einen beliebigen Wert fuer x ein:&quot; &lt;&lt; endl ;
  cout &lt;&lt;&quot; x : &quot;;
  cin &gt;&gt; x;
  cout &lt;&lt; &quot;x * x = &quot; &lt;&lt; x*x &lt;&lt; endl &lt;&lt; endl;
  cout &lt;&lt; &quot;Dies ist ihre letzte Rechnung! Danach wird das Programm geschlossen.&quot; &lt;&lt; endl &lt;&lt; endl;
  cout &lt;&lt;&quot; Die Anwedung ist die Bildung des Quadrates einer Zahl.&quot; &lt;&lt; endl ;
  cout &lt;&lt;&quot; Geben sie einen beliebigen Wert fuer x ein:&quot; &lt;&lt; endl ;
  cout &lt;&lt;&quot; x : &quot;;
  cin &gt;&gt; x;
  cout &lt;&lt; &quot;x * x = &quot; &lt;&lt; x*x &lt;&lt; endl &lt;&lt; endl;
  getchar ();

return 0;

}
</code></pre>
<p>wenn ich das passwort richtig eingebe springt er nicht zu dem richtigen Programm über und schließt das Fenster auch gleich nach 5 sek was er aber eig nur tun sollte wenn man das pw falsch eingibt.... bin langsam am verzweifeln hab schon fast alles rum probiert *g*</p>
<p>wenn ich die zeilen unter else weg nehme</p>
<p>Sleep (5000);<br />
return 0;</p>
<p>system(&quot;pause&gt;nul&quot;);<br />
return 0;</p>
<p>dann funktioniert es richtig wenn man das pw richtig eingibt. Allerdings startet das quadrier prog wenn man das pw dann falsch eingibt auch ^^ so soll das aber nich sein <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<p>achja und wenn ihr dann noch das eher mikrige programm zum Quadrieren anschaut , könnt ihr mir dann vielleicht noch verraten wie man mehrere Variablen hinzufügt das man die zahl die man eingibt vielleicht nicht immer mit der gleichen zahl erweitert wird? oder wie ich eine endlosschleife einbaue das man vielleicht mehr als 10 Rechnungen machen kann ??? ^^</p>
<p>wäre sehr froh wenn mir jemand helfen und mich aufklären könnte !</p>
<p>Mfg Prime01</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/221911/problem-beim-ersten-passwort-geschützten-prog</link><generator>RSS for Node</generator><lastBuildDate>Mon, 05 Oct 2026 22:48:35 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/221911.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 04 Sep 2008 21:42:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problem beim ersten Passwort geschützten Prog. on Thu, 04 Sep 2008 21:42:35 GMT]]></title><description><![CDATA[<p>Hi zusammen!</p>
<p>ich bin ein ziehmlicher neuling in C++ (lerne es gerade in einer ausbildung) und habe ein fast schon peinliches simples Prog geschrieben was Zahlen Quadriert. Dieses Prog wollte ich dann noch mit einem Passwortschutz versehen was aber nicht so ganz klappt</p>
<pre><code class="language-cpp">/* Test.cpp */               
#include &lt;stdio.h&gt;           
#include &lt;string.h&gt;
#include &lt;stdlib.h&gt;          
#include &lt;iostream&gt;       
#include &lt;conio.h&gt;           
#include &lt;windows.h&gt;

using namespace std;

int x = 0;     

int main () {

string password;
  cout &lt;&lt; &quot;Dieses Program benoetigt ein Passwort: &quot;;
  getline (cin, password);

  if (password == &quot;hallo&quot;) (
               cout &lt;&lt; &quot;\n Willkommen in dem Programm!&quot; &lt;&lt;endl
               );

  else (
       cout &lt;&lt; &quot;\n Passwort falsch! Fuck off!\n Beende das Programm in 5 sekunden...&quot;
       );
       Sleep (5000);
       return 0;

       system(&quot;pause&gt;nul&quot;);
       return 0;

  cout &lt;&lt;&quot; ***********************************************&quot;;
  cout &lt;&lt;                   &quot;*                             &quot; &lt;&lt;endl ;
  cout &lt;&lt;&quot; *                                              *&quot; &lt;&lt;endl ;
  cout &lt;&lt;&quot; *                      's tool                 *&quot; &lt;&lt;endl ;
  cout &lt;&lt;&quot; *                      zum                     *&quot; &lt;&lt;endl ;
  cout &lt;&lt;&quot; *                   Quadrieren                 *&quot; &lt;&lt;endl ;
  cout &lt;&lt;&quot; *                     v.1.0                    *&quot; &lt;&lt;endl ;
  cout &lt;&lt;&quot; *                                              *&quot; &lt;&lt;endl ;
  cout &lt;&lt;&quot; ************************************************&quot; &lt;&lt;endl &lt;&lt;endl ;
  cout &lt;&lt;&quot; Willkommen !&quot; &lt;&lt;endl;
  cout &lt;&lt;&quot; Dies ist ein einfaches Programm um Ganze Zahlen zu Quadrieren.&quot; &lt;&lt;endl;
  cout &lt;&lt;&quot; Die Anzahl ihrer Rechnungen sind begrenzt auf 10.&quot; &lt;&lt;endl;
  cout &lt;&lt;&quot; Sie haben noch 10 Rechnungen offen inkl. dieser hier!&quot; &lt;&lt; endl &lt;&lt; endl;
  cout &lt;&lt;&quot; Die Anwendung ist die Bildung des Quadrats einer Zahl.&quot; &lt;&lt; endl ;
  cout &lt;&lt;&quot; Geben sie einen beliebigen Wert fuer x ein:&quot; &lt;&lt; endl ;
  cout &lt;&lt; &quot;x : &quot;;            
  cin &gt;&gt; x;                  
  cout &lt;&lt; &quot;x * x = &quot; &lt;&lt; x*x &lt;&lt; endl &lt;&lt; endl ; 
  cout &lt;&lt; &quot;Sie haben noch 9 Rechnungen offen inkl. dieser hier!&quot; &lt;&lt; endl &lt;&lt; endl;
  cout &lt;&lt;&quot; Die Anwedung ist die Bildung des Quadrates einer Zahl.&quot; &lt;&lt; endl ;
  cout &lt;&lt;&quot; Geben sie einen beliebigen Wert fuer x ein:&quot; &lt;&lt; endl ;
  cout &lt;&lt;&quot; x : &quot;;
  cin &gt;&gt; x;
  cout &lt;&lt; &quot;x * x = &quot; &lt;&lt; x*x &lt;&lt; endl &lt;&lt; endl;
  cout &lt;&lt; &quot;Sie haben noch 8 Rechnungen offen inkl. dieser hier!&quot; &lt;&lt; endl &lt;&lt; endl;
  cout &lt;&lt;&quot; Die Anwedung ist die Bildung des Quadrates einer Zahl.&quot; &lt;&lt; endl ;
  cout &lt;&lt;&quot; Geben sie einen beliebigen Wert fuer x ein:&quot; &lt;&lt; endl ;
  cout &lt;&lt;&quot; x : &quot;;
  cin &gt;&gt; x;
  cout &lt;&lt; &quot;x * x = &quot; &lt;&lt; x*x &lt;&lt; endl &lt;&lt; endl;
  cout &lt;&lt; &quot;Sie haben noch 7 Rechnungen offen inkl. dieser hier!&quot; &lt;&lt; endl &lt;&lt; endl;
  cout &lt;&lt;&quot; Die Anwedung ist die Bildung des Quadrates einer Zahl.&quot; &lt;&lt; endl ;
  cout &lt;&lt;&quot; Geben sie einen beliebigen Wert fuer x ein:&quot; &lt;&lt; endl ;
  cout &lt;&lt;&quot; x : &quot;;
  cin &gt;&gt; x;
  cout &lt;&lt; &quot;x * x = &quot; &lt;&lt; x*x &lt;&lt; endl &lt;&lt; endl;
  cout &lt;&lt; &quot;Sie haben noch 6 Rechnungen offen inkl. dieser hier!&quot; &lt;&lt; endl &lt;&lt; endl;
  cout &lt;&lt;&quot; Die Anwedung ist die Bildung des Quadrates einer Zahl.&quot; &lt;&lt; endl ;
  cout &lt;&lt;&quot; Geben sie einen beliebigen Wert fuer x ein:&quot; &lt;&lt; endl ;
  cout &lt;&lt;&quot; x : &quot;;
  cin &gt;&gt; x;
  cout &lt;&lt; &quot;x * x = &quot; &lt;&lt; x*x &lt;&lt; endl &lt;&lt; endl;
  cout &lt;&lt; &quot;Sie haben noch 5 Rechnungen offen inkl. dieser hier!&quot; &lt;&lt; endl &lt;&lt; endl;
  cout &lt;&lt;&quot; Die Anwedung ist die Bildung des Quadrates einer Zahl.&quot; &lt;&lt; endl ;
  cout &lt;&lt;&quot; Geben sie einen beliebigen Wert fuer x ein:&quot; &lt;&lt; endl ;
  cout &lt;&lt;&quot; x : &quot;;
  cin &gt;&gt; x;
  cout &lt;&lt; &quot;x * x = &quot; &lt;&lt; x*x &lt;&lt; endl &lt;&lt; endl;
  cout &lt;&lt; &quot;Sie haben noch 4 Rechnungen offen inkl. dieser hier!&quot; &lt;&lt; endl &lt;&lt; endl;
  cout &lt;&lt;&quot; Die Anwedung ist die Bildung des Quadrates einer Zahl.&quot; &lt;&lt; endl ;
  cout &lt;&lt;&quot; Geben sie einen beliebigen Wert fuer x ein:&quot; &lt;&lt; endl ;
  cout &lt;&lt;&quot; x : &quot;;
  cin &gt;&gt; x;
  cout &lt;&lt; &quot;x * x = &quot; &lt;&lt; x*x &lt;&lt; endl &lt;&lt; endl;
  cout &lt;&lt; &quot;Sie haben noch 3 Rechnungen offen inkl. dieser hier!&quot; &lt;&lt; endl &lt;&lt; endl;
  cout &lt;&lt;&quot; Die Anwedung ist die Bildung des Quadrates einer Zahl.&quot; &lt;&lt; endl ;
  cout &lt;&lt;&quot; Geben sie einen beliebigen Wert fuer x ein:&quot; &lt;&lt; endl ;
  cout &lt;&lt;&quot; x : &quot;;
  cin &gt;&gt; x;
  cout &lt;&lt; &quot;x * x = &quot; &lt;&lt; x*x &lt;&lt; endl &lt;&lt; endl;
  cout &lt;&lt; &quot;Sie haben noch 2 Rechnungen offen inkl. dieser hier!&quot; &lt;&lt; endl &lt;&lt; endl;
  cout &lt;&lt;&quot; Die Anwedung ist die Bildung des Quadrates einer Zahl.&quot; &lt;&lt; endl ;
  cout &lt;&lt;&quot; Geben sie einen beliebigen Wert fuer x ein:&quot; &lt;&lt; endl ;
  cout &lt;&lt;&quot; x : &quot;;
  cin &gt;&gt; x;
  cout &lt;&lt; &quot;x * x = &quot; &lt;&lt; x*x &lt;&lt; endl &lt;&lt; endl;
  cout &lt;&lt; &quot;Sie haben noch 1 Rechnungen offen inkl. dieser hier!&quot; &lt;&lt; endl &lt;&lt; endl;
  cout &lt;&lt;&quot; Die Anwedung ist die Bildung des Quadrates einer Zahl.&quot; &lt;&lt; endl ;
  cout &lt;&lt;&quot; Geben sie einen beliebigen Wert fuer x ein:&quot; &lt;&lt; endl ;
  cout &lt;&lt;&quot; x : &quot;;
  cin &gt;&gt; x;
  cout &lt;&lt; &quot;x * x = &quot; &lt;&lt; x*x &lt;&lt; endl &lt;&lt; endl;
  cout &lt;&lt; &quot;Dies ist ihre letzte Rechnung! Danach wird das Programm geschlossen.&quot; &lt;&lt; endl &lt;&lt; endl;
  cout &lt;&lt;&quot; Die Anwedung ist die Bildung des Quadrates einer Zahl.&quot; &lt;&lt; endl ;
  cout &lt;&lt;&quot; Geben sie einen beliebigen Wert fuer x ein:&quot; &lt;&lt; endl ;
  cout &lt;&lt;&quot; x : &quot;;
  cin &gt;&gt; x;
  cout &lt;&lt; &quot;x * x = &quot; &lt;&lt; x*x &lt;&lt; endl &lt;&lt; endl;
  getchar ();

return 0;

}
</code></pre>
<p>wenn ich das passwort richtig eingebe springt er nicht zu dem richtigen Programm über und schließt das Fenster auch gleich nach 5 sek was er aber eig nur tun sollte wenn man das pw falsch eingibt.... bin langsam am verzweifeln hab schon fast alles rum probiert *g*</p>
<p>wenn ich die zeilen unter else weg nehme</p>
<p>Sleep (5000);<br />
return 0;</p>
<p>system(&quot;pause&gt;nul&quot;);<br />
return 0;</p>
<p>dann funktioniert es richtig wenn man das pw richtig eingibt. Allerdings startet das quadrier prog wenn man das pw dann falsch eingibt auch ^^ so soll das aber nich sein <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<p>achja und wenn ihr dann noch das eher mikrige programm zum Quadrieren anschaut , könnt ihr mir dann vielleicht noch verraten wie man mehrere Variablen hinzufügt das man die zahl die man eingibt vielleicht nicht immer mit der gleichen zahl erweitert wird? oder wie ich eine endlosschleife einbaue das man vielleicht mehr als 10 Rechnungen machen kann ??? ^^</p>
<p>wäre sehr froh wenn mir jemand helfen und mich aufklären könnte !</p>
<p>Mfg Prime01</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1576816</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1576816</guid><dc:creator><![CDATA[Prime01]]></dc:creator><pubDate>Thu, 04 Sep 2008 21:42:35 GMT</pubDate></item><item><title><![CDATA[Reply to Problem beim ersten Passwort geschützten Prog. on Thu, 04 Sep 2008 21:54:38 GMT]]></title><description><![CDATA[<p>Ich würde <strong>dringend</strong> zu Schleifen und Funktionen raten, dann sparst du dir<br />
die eklige Codeduplizierung!</p>
<p>Scope-Klammern sind geschweifte {}, nicht runde (). Du solltest ausserdem auf die Blöcke achten, dein Programm wird in jedem Falle beendet. Anweisungen nach <code>return</code> werden zudem <strong>nie</strong> ausgeführt.</p>
<p>C-Header, die in C++ eingesetzt werden, haben ein c vorne dran, dafür keine Endung. Also &lt;cstring&gt; statt &lt;string.h&gt;, &lt;cstdlib&gt; statt &lt;stdlib.h&gt; etc.</p>
<p>Von den windows-spezifischen Funktionen wie <code>Sleep()</code> und <code>system()</code> rate ich im Übrigen ab.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1576821</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1576821</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Thu, 04 Sep 2008 21:54:38 GMT</pubDate></item><item><title><![CDATA[Reply to Problem beim ersten Passwort geschützten Prog. on Fri, 05 Sep 2008 01:36:24 GMT]]></title><description><![CDATA[<p>ich bin mal so nett:</p>
<blockquote>
<p>achja und wenn ihr dann noch das eher mikrige programm zum Quadrieren anschaut , könnt ihr mir dann vielleicht noch verraten wie man mehrere Variablen hinzufügt das man die zahl die man eingibt vielleicht nicht immer mit der gleichen zahl erweitert wird?</p>
</blockquote>
<p>versuchs mal mit der <a href="http://www.cplusplus.com/reference/clibrary/cmath/pow.html" rel="nofollow">pow()</a> Funktion</p>
<blockquote>
<p>oder wie ich eine endlosschleife einbaue das man vielleicht mehr als 10 Rechnungen machen kann ??? ^^</p>
</blockquote>
<p>Da ich gerade zeit hab:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;string&gt;
#include &lt;cmath&gt;

int main()
{
	std::string password;
	double a, b;

	do
	{
		std::cout &lt;&lt; &quot;passwort eingeben: &quot;;
		std::getline( std::cin, password );
	} while( password != &quot;passwort&quot; );

	while( true )
	{
		std::cout &lt;&lt; &quot;zahl eingeben: &quot;;
		std::cin &gt;&gt; a;

		std::cout &lt;&lt; &quot;Potenz:        &quot;;
		std::cin &gt;&gt; b;

		std::cout &lt;&lt; &quot;ergebnis:      &quot; &lt;&lt; std::pow( a, b ) &lt;&lt; '\n' &lt;&lt; std::endl;
	}
}
</code></pre>
<p>mfg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1576859</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1576859</guid><dc:creator><![CDATA[double *T]]></dc:creator><pubDate>Fri, 05 Sep 2008 01:36:24 GMT</pubDate></item><item><title><![CDATA[Reply to Problem beim ersten Passwort geschützten Prog. on Fri, 05 Sep 2008 07:31:44 GMT]]></title><description><![CDATA[<p>Oder mach das einfach mit einer Funktion.</p>
<p>Ist zwar nicht die beste Lösung aber ich glaube für den Anfang die leichteste</p>
<p><a href="http://www.cpp-tutor.de/cpp/intro/toc.htm" rel="nofollow">http://www.cpp-tutor.de/cpp/intro/toc.htm</a></p>
<p><a href="http://www.cpp-tutor.de/cpp/le07/le07_01.htm" rel="nofollow">http://www.cpp-tutor.de/cpp/le07/le07_01.htm</a> &lt;-- Funktionen</p>
<pre><code class="language-cpp">#include &lt;stdio.h&gt;
#include &lt;string.h&gt; 
#include &lt;stdlib.h&gt;           
#include &lt;iostream&gt;       
#include &lt;conio.h&gt;           
#include &lt;windows.h&gt; 

using namespace std; 

int x = 0;     

int main ()
{

int programm();

string password; 
  cout &lt;&lt; &quot;Dieses Program benoetigt ein Passwort: &quot;; 
  getline (cin, password); 

  if (password == &quot;hallo&quot;)
   {
      cout &lt;&lt; &quot;\n Willkommen in dem Programm!&quot; &lt;&lt;endl;
      programm();
   }

  else {
       cout &lt;&lt; &quot;\n Passwort falsch! love off!\n Beende das Programm in 5 sekunden...&quot;;
       Sleep (5000);
       return 0;
      }

}

int programm()
{
cout &lt;&lt;&quot; ***********************************************&quot;; 
  cout &lt;&lt;                   &quot;*                             &quot; &lt;&lt;endl ; 
  cout &lt;&lt;&quot; *                                              *&quot; &lt;&lt;endl ; 
  cout &lt;&lt;&quot; *                      's tool                 *&quot; &lt;&lt;endl ; 
  cout &lt;&lt;&quot; *                      zum                     *&quot; &lt;&lt;endl ; 
  cout &lt;&lt;&quot; *                   Quadrieren                 *&quot; &lt;&lt;endl ; 
  cout &lt;&lt;&quot; *                     v.1.0                    *&quot; &lt;&lt;endl ; 
  cout &lt;&lt;&quot; *                                              *&quot; &lt;&lt;endl ; 
  cout &lt;&lt;&quot; ************************************************&quot; &lt;&lt;endl &lt;&lt;endl ; 
  cout &lt;&lt;&quot; Willkommen !&quot; &lt;&lt;endl; 
  cout &lt;&lt;&quot; Dies ist ein einfaches Programm um Ganze Zahlen zu Quadrieren.&quot; &lt;&lt;endl; 
  cout &lt;&lt;&quot; Die Anzahl ihrer Rechnungen sind begrenzt auf 10.&quot; &lt;&lt;endl; 
  cout &lt;&lt;&quot; Sie haben noch 10 Rechnungen offen inkl. dieser hier!&quot; &lt;&lt; endl &lt;&lt; endl; 
  cout &lt;&lt;&quot; Die Anwendung ist die Bildung des Quadrats einer Zahl.&quot; &lt;&lt; endl ; 
  cout &lt;&lt;&quot; Geben sie einen beliebigen Wert fuer x ein:&quot; &lt;&lt; endl ; 
  cout &lt;&lt; &quot;x : &quot;;             
  cin &gt;&gt; x;                   
  cout &lt;&lt; &quot;x * x = &quot; &lt;&lt; x*x &lt;&lt; endl &lt;&lt; endl ; 
  cout &lt;&lt; &quot;Sie haben noch 9 Rechnungen offen inkl. dieser hier!&quot; &lt;&lt; endl &lt;&lt; endl; 
  cout &lt;&lt;&quot; Die Anwedung ist die Bildung des Quadrates einer Zahl.&quot; &lt;&lt; endl ; 
  cout &lt;&lt;&quot; Geben sie einen beliebigen Wert fuer x ein:&quot; &lt;&lt; endl ; 
  cout &lt;&lt;&quot; x : &quot;; 
  cin &gt;&gt; x; 
  cout &lt;&lt; &quot;x * x = &quot; &lt;&lt; x*x &lt;&lt; endl &lt;&lt; endl; 
  cout &lt;&lt; &quot;Sie haben noch 8 Rechnungen offen inkl. dieser hier!&quot; &lt;&lt; endl &lt;&lt; endl; 
  cout &lt;&lt;&quot; Die Anwedung ist die Bildung des Quadrates einer Zahl.&quot; &lt;&lt; endl ; 
  cout &lt;&lt;&quot; Geben sie einen beliebigen Wert fuer x ein:&quot; &lt;&lt; endl ; 
  cout &lt;&lt;&quot; x : &quot;; 
  cin &gt;&gt; x; 
  cout &lt;&lt; &quot;x * x = &quot; &lt;&lt; x*x &lt;&lt; endl &lt;&lt; endl; 
  cout &lt;&lt; &quot;Sie haben noch 7 Rechnungen offen inkl. dieser hier!&quot; &lt;&lt; endl &lt;&lt; endl; 
  cout &lt;&lt;&quot; Die Anwedung ist die Bildung des Quadrates einer Zahl.&quot; &lt;&lt; endl ; 
  cout &lt;&lt;&quot; Geben sie einen beliebigen Wert fuer x ein:&quot; &lt;&lt; endl ; 
  cout &lt;&lt;&quot; x : &quot;; 
  cin &gt;&gt; x; 
  cout &lt;&lt; &quot;x * x = &quot; &lt;&lt; x*x &lt;&lt; endl &lt;&lt; endl; 
  cout &lt;&lt; &quot;Sie haben noch 6 Rechnungen offen inkl. dieser hier!&quot; &lt;&lt; endl &lt;&lt; endl; 
  cout &lt;&lt;&quot; Die Anwedung ist die Bildung des Quadrates einer Zahl.&quot; &lt;&lt; endl ; 
  cout &lt;&lt;&quot; Geben sie einen beliebigen Wert fuer x ein:&quot; &lt;&lt; endl ; 
  cout &lt;&lt;&quot; x : &quot;; 
  cin &gt;&gt; x; 
  cout &lt;&lt; &quot;x * x = &quot; &lt;&lt; x*x &lt;&lt; endl &lt;&lt; endl; 
  cout &lt;&lt; &quot;Sie haben noch 5 Rechnungen offen inkl. dieser hier!&quot; &lt;&lt; endl &lt;&lt; endl; 
  cout &lt;&lt;&quot; Die Anwedung ist die Bildung des Quadrates einer Zahl.&quot; &lt;&lt; endl ; 
  cout &lt;&lt;&quot; Geben sie einen beliebigen Wert fuer x ein:&quot; &lt;&lt; endl ; 
  cout &lt;&lt;&quot; x : &quot;; 
  cin &gt;&gt; x; 
  cout &lt;&lt; &quot;x * x = &quot; &lt;&lt; x*x &lt;&lt; endl &lt;&lt; endl; 
  cout &lt;&lt; &quot;Sie haben noch 4 Rechnungen offen inkl. dieser hier!&quot; &lt;&lt; endl &lt;&lt; endl; 
  cout &lt;&lt;&quot; Die Anwedung ist die Bildung des Quadrates einer Zahl.&quot; &lt;&lt; endl ; 
  cout &lt;&lt;&quot; Geben sie einen beliebigen Wert fuer x ein:&quot; &lt;&lt; endl ; 
  cout &lt;&lt;&quot; x : &quot;; 
  cin &gt;&gt; x; 
  cout &lt;&lt; &quot;x * x = &quot; &lt;&lt; x*x &lt;&lt; endl &lt;&lt; endl; 
  cout &lt;&lt; &quot;Sie haben noch 3 Rechnungen offen inkl. dieser hier!&quot; &lt;&lt; endl &lt;&lt; endl; 
  cout &lt;&lt;&quot; Die Anwedung ist die Bildung des Quadrates einer Zahl.&quot; &lt;&lt; endl ; 
  cout &lt;&lt;&quot; Geben sie einen beliebigen Wert fuer x ein:&quot; &lt;&lt; endl ; 
  cout &lt;&lt;&quot; x : &quot;; 
  cin &gt;&gt; x; 
  cout &lt;&lt; &quot;x * x = &quot; &lt;&lt; x*x &lt;&lt; endl &lt;&lt; endl; 
  cout &lt;&lt; &quot;Sie haben noch 2 Rechnungen offen inkl. dieser hier!&quot; &lt;&lt; endl &lt;&lt; endl; 
  cout &lt;&lt;&quot; Die Anwedung ist die Bildung des Quadrates einer Zahl.&quot; &lt;&lt; endl ; 
  cout &lt;&lt;&quot; Geben sie einen beliebigen Wert fuer x ein:&quot; &lt;&lt; endl ; 
  cout &lt;&lt;&quot; x : &quot;; 
  cin &gt;&gt; x; 
  cout &lt;&lt; &quot;x * x = &quot; &lt;&lt; x*x &lt;&lt; endl &lt;&lt; endl; 
  cout &lt;&lt; &quot;Sie haben noch 1 Rechnungen offen inkl. dieser hier!&quot; &lt;&lt; endl &lt;&lt; endl; 
  cout &lt;&lt;&quot; Die Anwedung ist die Bildung des Quadrates einer Zahl.&quot; &lt;&lt; endl ; 
  cout &lt;&lt;&quot; Geben sie einen beliebigen Wert fuer x ein:&quot; &lt;&lt; endl ; 
  cout &lt;&lt;&quot; x : &quot;; 
  cin &gt;&gt; x; 
  cout &lt;&lt; &quot;x * x = &quot; &lt;&lt; x*x &lt;&lt; endl &lt;&lt; endl; 
  cout &lt;&lt; &quot;Dies ist ihre letzte Rechnung! Danach wird das Programm geschlossen.&quot; &lt;&lt; endl &lt;&lt; endl; 
  cout &lt;&lt;&quot; Die Anwedung ist die Bildung des Quadrates einer Zahl.&quot; &lt;&lt; endl ; 
  cout &lt;&lt;&quot; Geben sie einen beliebigen Wert fuer x ein:&quot; &lt;&lt; endl ; 
  cout &lt;&lt;&quot; x : &quot;; 
  cin &gt;&gt; x; 
  cout &lt;&lt; &quot;x * x = &quot; &lt;&lt; x*x &lt;&lt; endl &lt;&lt; endl; 
  getchar ();

   return 0;

}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1576949</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1576949</guid><dc:creator><![CDATA[roflcopter]]></dc:creator><pubDate>Fri, 05 Sep 2008 07:31:44 GMT</pubDate></item><item><title><![CDATA[Reply to Problem beim ersten Passwort geschützten Prog. on Fri, 05 Sep 2008 20:34:11 GMT]]></title><description><![CDATA[<p>erstmal Vielen Dank für eure Antworten !</p>
<p>double *T schrieb:</p>
<blockquote>
<p>ich bin mal so nett:</p>
<blockquote>
<p>achja und wenn ihr dann noch das eher mikrige programm zum Quadrieren anschaut , könnt ihr mir dann vielleicht noch verraten wie man mehrere Variablen hinzufügt das man die zahl die man eingibt vielleicht nicht immer mit der gleichen zahl erweitert wird?</p>
</blockquote>
<p>versuchs mal mit der <a href="http://www.cplusplus.com/reference/clibrary/cmath/pow.html" rel="nofollow">pow()</a> Funktion</p>
<blockquote>
<p>oder wie ich eine endlosschleife einbaue das man vielleicht mehr als 10 Rechnungen machen kann ??? ^^</p>
</blockquote>
<p>Da ich gerade zeit hab:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;string&gt;
#include &lt;cmath&gt;

int main()
{
	std::string password;
	double a, b;
	
	do
	{
		std::cout &lt;&lt; &quot;passwort eingeben: &quot;;
		std::getline( std::cin, password );
	} while( password != &quot;passwort&quot; );
	
	while( true )
	{
		std::cout &lt;&lt; &quot;zahl eingeben: &quot;;
		std::cin &gt;&gt; a;
		
		std::cout &lt;&lt; &quot;Potenz:        &quot;;
		std::cin &gt;&gt; b;
		
		std::cout &lt;&lt; &quot;ergebnis:      &quot; &lt;&lt; std::pow( a, b ) &lt;&lt; '\n' &lt;&lt; std::endl;
	}
}
</code></pre>
<p>mfg</p>
</blockquote>
<p>vielen dank dafür ! allerdings komme ich nicht über die Passwort Frage weg. Ich interpretiere es so das &quot;passwort&quot; das pw sein soll. Wenn man es allerdings eingibt fragt er immer wieder nach dem Passwort und springt nicht zum main programm.<br />
kann mich da vllt noch jemand aufklären? wäre sehr dankbar!</p>
<p>mfg Prime01</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1577280</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1577280</guid><dc:creator><![CDATA[Prime01]]></dc:creator><pubDate>Fri, 05 Sep 2008 20:34:11 GMT</pubDate></item><item><title><![CDATA[Reply to Problem beim ersten Passwort geschützten Prog. on Fri, 05 Sep 2008 20:39:27 GMT]]></title><description><![CDATA[<p>Kann ich nicht bestätigen. Das Programm funktioniert bei mir einwandfrei.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1577284</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1577284</guid><dc:creator><![CDATA[YASC]]></dc:creator><pubDate>Fri, 05 Sep 2008 20:39:27 GMT</pubDate></item><item><title><![CDATA[Reply to Problem beim ersten Passwort geschützten Prog. on Fri, 05 Sep 2008 20:59:52 GMT]]></title><description><![CDATA[<p>hmm und das passwort ist bei dir: &quot;Passwort&quot;?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1577288</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1577288</guid><dc:creator><![CDATA[Prime01]]></dc:creator><pubDate>Fri, 05 Sep 2008 20:59:52 GMT</pubDate></item><item><title><![CDATA[Reply to Problem beim ersten Passwort geschützten Prog. on Fri, 05 Sep 2008 21:02:40 GMT]]></title><description><![CDATA[<blockquote>
<p>hmm und das passwort ist bei dir: &quot;Passwort&quot;?</p>
</blockquote>
<p>Groß- und Kleinschreibung beachtet?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1577289</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1577289</guid><dc:creator><![CDATA[JustAnotherNoob]]></dc:creator><pubDate>Fri, 05 Sep 2008 21:02:40 GMT</pubDate></item><item><title><![CDATA[Reply to Problem beim ersten Passwort geschützten Prog. on Fri, 05 Sep 2008 21:20:01 GMT]]></title><description><![CDATA[<p>hab ich, &quot;passwort&quot; aber funktionieren tut es immer noch nicht <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /> benutze derzeit C++ Builder 5 von Borland weiß ja nicht vllt hat es auch was mit dem Compiler zu tun ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1577302</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1577302</guid><dc:creator><![CDATA[Prime01]]></dc:creator><pubDate>Fri, 05 Sep 2008 21:20:01 GMT</pubDate></item><item><title><![CDATA[Reply to Problem beim ersten Passwort geschützten Prog. on Fri, 05 Sep 2008 21:23:58 GMT]]></title><description><![CDATA[<p>BCB5 ist schon sehr alt <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /> Möglich wäre, dass der einen Fehler in std::getline hat und das newline Zeichen noch mit in den String schiebt. Halte ich aber für unwahrscheinlich.<br />
Am besten du holst dir mal MS Visual C++ 2008 Express Edition (gibts for free zum runterladen), dann könnte man das schonmal ausschließen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1577304</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1577304</guid><dc:creator><![CDATA[YASC]]></dc:creator><pubDate>Fri, 05 Sep 2008 21:23:58 GMT</pubDate></item><item><title><![CDATA[Reply to Problem beim ersten Passwort geschützten Prog. on Fri, 05 Sep 2008 21:26:22 GMT]]></title><description><![CDATA[<p>Benutz mal ne Schleife Digga:</p>
<pre><code class="language-cpp">int array[10];
for(int zarray=0; zarray &lt; 11; zarray++)
{
array[i] = i;
}

for(int i=0;i=11;i++)
{
cout &lt;&lt; &quot;x * x = &quot; &lt;&lt; x*x &lt;&lt; endl &lt;&lt; endl ;
  cout &lt;&lt; &quot;Sie haben noch&quot; &lt;&lt; array[i] &lt;&lt;  Rechnungen offen inkl. dieser hier!&quot;&lt;&lt;  endl &lt;&lt; endl;
  cout &lt;&lt;&quot; Die Anwedung ist die Bildung des Quadrates einer Zahl.&quot; &lt;&lt; endl ;
  cout &lt;&lt;&quot; Geben sie einen beliebigen Wert fuer x ein:&quot; &lt;&lt; endl ;
  cout &lt;&lt;&quot; x : &quot;; 
 }

//blablabla
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1577306</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1577306</guid><dc:creator><![CDATA[Gebangt]]></dc:creator><pubDate>Fri, 05 Sep 2008 21:26:22 GMT</pubDate></item><item><title><![CDATA[Reply to Problem beim ersten Passwort geschützten Prog. on Fri, 05 Sep 2008 23:42:59 GMT]]></title><description><![CDATA[<p>Prime01 schrieb:</p>
<blockquote>
<p>hab ich, &quot;passwort&quot; aber funktionieren tut es immer noch nicht <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /> benutze derzeit C++ Builder 5 von Borland weiß ja nicht vllt hat es auch was mit dem Compiler zu tun ?</p>
</blockquote>
<p>versuch doch mal <code>std::getline();</code> mit <code>std::cin &gt;&gt; password;</code> zu ersetzen. Wenns dann geht liegts 100% am Compiler.</p>
<p>Gebangt schrieb:</p>
<blockquote>
<pre><code class="language-cpp">int array[10];
for(int zarray=0; zarray &lt; 11; zarray++)
{
array[i] = i;
}

  //...
  cout &lt;&lt; &quot;Sie haben noch&quot; &lt;&lt; array[i] &lt;&lt;  Rechnungen offen inkl. dieser hier!&quot;&lt;&lt;  endl &lt;&lt; endl;
  //...

//blablabla
</code></pre>
</blockquote>
<p>was soll denn das werden <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /> ? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_down"
      title=":-1:"
      alt="👎"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1577334</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1577334</guid><dc:creator><![CDATA[double *T]]></dc:creator><pubDate>Fri, 05 Sep 2008 23:42:59 GMT</pubDate></item></channel></rss>