<?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[Compiler-Fehler bei if-Anweisung]]></title><description><![CDATA[<p>Liebe Gemeinde,<br />
was ist hier falsch?</p>
<pre><code class="language-cpp">LRESULT CALLBACK CheckEditProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	char chk_pswd[9];
   int chk_numb = 0;

   switch (uMsg)
   {

   	case WM_INITDIALOG:
      	SetDlgItemText(hDlg, IDC_CONTROLEDIT1, &quot;password&quot;);
         SetDlgItemInt (hDlg, IDC_CONTROLEDIT2, 12345, TRUE);
         break;

      case WM_COMMAND:
      	switch (LOWORD (wParam))
         {
         	BOOL btran;
            case IDOK: 

               GetDlgItemText (hDlg, IDC_CONTROLEDIT1, chk_pswd, sizeof(chk_pswd)-1);

               chk_numb = GetDlgItemInt (hDlg, IDC_CONTROLEDIT2, &amp;btran, TRUE);

               if ((strcmp(chk_pswd, PASSWORD) == 0) &amp;&amp; (chk_numb == NUMMER))//Hier tritt der Fehler auf, s. u.
               {
               	MessageBox(hDlg, &quot;Login erfolgreich&quot;, &quot;Willkommen&quot;, MB_OK);
               }
               else
               	MessageBox(hDlg, &quot;Zugriff verweigert&quot;, &quot;Passwort falsch&quot;, MB_OK);

               EndDialog(hDlg, IDOK);
               break;
            case IDCANCEL:
            EndDialog(hDlg, IDCANCEL);
            break;
         }
      break;
      default:
      	return (FALSE);
   }
	return (TRUE);
}
</code></pre>
<p>Wie man sieht, versuche ich ein Programm mit Dialogboxen zu schreiben. Aber bei der if-Anweisung gibt mir der Compiler (Borland C++) die Fehlermeldung</p>
<pre><code>) expected//gemeint ist die schließende Klammer
If statement missing )
expression syntax
</code></pre>
<p>Ich kann mir das nicht erklären, weil ich die Klammern und Semikolons x-mal durchgezählt habe.<br />
Wer hilft mir weiter?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/137912/compiler-fehler-bei-if-anweisung</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Jul 2026 19:38:31 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/137912.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 21 Feb 2006 19:44:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Compiler-Fehler bei if-Anweisung on Tue, 21 Feb 2006 19:45:59 GMT]]></title><description><![CDATA[<p>Liebe Gemeinde,<br />
was ist hier falsch?</p>
<pre><code class="language-cpp">LRESULT CALLBACK CheckEditProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	char chk_pswd[9];
   int chk_numb = 0;

   switch (uMsg)
   {

   	case WM_INITDIALOG:
      	SetDlgItemText(hDlg, IDC_CONTROLEDIT1, &quot;password&quot;);
         SetDlgItemInt (hDlg, IDC_CONTROLEDIT2, 12345, TRUE);
         break;

      case WM_COMMAND:
      	switch (LOWORD (wParam))
         {
         	BOOL btran;
            case IDOK: 

               GetDlgItemText (hDlg, IDC_CONTROLEDIT1, chk_pswd, sizeof(chk_pswd)-1);

               chk_numb = GetDlgItemInt (hDlg, IDC_CONTROLEDIT2, &amp;btran, TRUE);

               if ((strcmp(chk_pswd, PASSWORD) == 0) &amp;&amp; (chk_numb == NUMMER))//Hier tritt der Fehler auf, s. u.
               {
               	MessageBox(hDlg, &quot;Login erfolgreich&quot;, &quot;Willkommen&quot;, MB_OK);
               }
               else
               	MessageBox(hDlg, &quot;Zugriff verweigert&quot;, &quot;Passwort falsch&quot;, MB_OK);

               EndDialog(hDlg, IDOK);
               break;
            case IDCANCEL:
            EndDialog(hDlg, IDCANCEL);
            break;
         }
      break;
      default:
      	return (FALSE);
   }
	return (TRUE);
}
</code></pre>
<p>Wie man sieht, versuche ich ein Programm mit Dialogboxen zu schreiben. Aber bei der if-Anweisung gibt mir der Compiler (Borland C++) die Fehlermeldung</p>
<pre><code>) expected//gemeint ist die schließende Klammer
If statement missing )
expression syntax
</code></pre>
<p>Ich kann mir das nicht erklären, weil ich die Klammern und Semikolons x-mal durchgezählt habe.<br />
Wer hilft mir weiter?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/999724</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/999724</guid><dc:creator><![CDATA[Elektronix]]></dc:creator><pubDate>Tue, 21 Feb 2006 19:45:59 GMT</pubDate></item><item><title><![CDATA[Reply to Compiler-Fehler bei if-Anweisung on Tue, 21 Feb 2006 19:49:12 GMT]]></title><description><![CDATA[<p>Fehler findet man durch minimierung auf das nötigste.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/999734</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/999734</guid><dc:creator><![CDATA[tipp]]></dc:creator><pubDate>Tue, 21 Feb 2006 19:49:12 GMT</pubDate></item><item><title><![CDATA[Reply to Compiler-Fehler bei if-Anweisung on Tue, 21 Feb 2006 20:22:13 GMT]]></title><description><![CDATA[<p>Elektronix schrieb:</p>
<blockquote>
<p>Ich kann mir das nicht erklären, weil ich die Klammern und Semikolons x-mal durchgezählt habe.</p>
</blockquote>
<p>Ich vermute da ein überflüssiges Semikolon bei der Definedirektive für PASSWORD oder NUMMER.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/999766</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/999766</guid><dc:creator><![CDATA[MFK]]></dc:creator><pubDate>Tue, 21 Feb 2006 20:22:13 GMT</pubDate></item><item><title><![CDATA[Reply to Compiler-Fehler bei if-Anweisung on Wed, 22 Feb 2006 19:04:22 GMT]]></title><description><![CDATA[<p>MFK schrieb:</p>
<blockquote>
<p>Ich vermute da ein überflüssiges Semikolon bei der Definedirektive für PASSWORD oder NUMMER.</p>
</blockquote>
<p>Wow, Du bist klasse! Woher hast Du das gewußt? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f4a1.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--light_bulb"
      title=":bulb:"
      alt="💡"
    /><br />
Danke vielmals!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1000557</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1000557</guid><dc:creator><![CDATA[Elektronix]]></dc:creator><pubDate>Wed, 22 Feb 2006 19:04:22 GMT</pubDate></item></channel></rss>