<?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[char* von if nicht erkannt]]></title><description><![CDATA[<p>Hallo alle zusammen,</p>
<p>Ich will ein Programm schreiben, das manche Flughäfen erkennt und dafür die richtigen<br />
Koordinaten einsetzt, wenn es sie kennt. Sonst soll ein else-Block aufgerufen werden, um<br />
die Koordinaten per Hand einzutragen. Hier der Header und die Implementierung:</p>
<p>Header:</p>
<pre><code class="language-cpp">#ifndef EIGEN_H
#define EIGEN_H

#include &lt;windows.h&gt;
#include &lt;iostream&gt;

namespace Zeichen
    {
        const unsigned char AE = static_cast&lt;unsigned char&gt;(142);
        const unsigned char ae = static_cast&lt;unsigned char&gt;(132);
        const unsigned char OE = static_cast&lt;unsigned char&gt;(153);
        const unsigned char oe = static_cast&lt;unsigned char&gt;(148);
        const unsigned char UE = static_cast&lt;unsigned char&gt;(154);
        const unsigned char ue = static_cast&lt;unsigned char&gt;(129);
        const unsigned char ss = static_cast&lt;unsigned char&gt;(225);
        const unsigned char gr = static_cast&lt;unsigned char&gt;(248);
    }

struct koord {
           int lg;
           int lm;
           int ls;
           char lae;
           int bg;
           int bm;
           int bs;
           char bre;
    };

void punkte (int, int=500);

void einfuegen (char *, koord* );

#endif
</code></pre>
<p>Die Implementierung:</p>
<pre><code class="language-cpp">#include &quot;eigen.h&quot;
using namespace std;
void punkte( int a,int b) {
     for(int i=0; i &lt;= a; i++) {
             cout &lt;&lt; &quot;.&quot; &lt;&lt; flush;
             Sleep ( b );
             }
     }

void einfuegen (char* a, koord* koords) {
     int qqq=0;
     if (a == &quot;Frankfurt&quot; || a == &quot;EDDF&quot; || a == &quot;eddf&quot; || a == &quot;FRA&quot; ||
        a == &quot;fra&quot; || a == &quot;frankfurt&quot; || a == &quot;FRANKFURT&quot;) {
          a = &quot;Frankfurt&quot;;
          koords-&gt;lg=50;koords-&gt;lm=1;koords-&gt;lae='N';koords-&gt;bg=8;
          koords-&gt;bm=32;koords-&gt;bre='O';koords-&gt;ls=35;koords-&gt;bs=35;
          }
     else { qqq = 1;
          cout &lt;&lt; &quot;Leider ist &quot; &lt;&lt; a &lt;&lt; &quot; in der Datenbank des &quot; &lt;&lt; endl;
          cout &lt;&lt; &quot;Programms nicht vorhanden. Bitte geben sie die &quot; &lt;&lt; endl;
          cout &lt;&lt; &quot;Koordinaten von &quot; &lt;&lt; a &lt;&lt; &quot; ein.\n&quot; &lt;&lt; endl;
          cout &lt;&lt; &quot;Bitte beachen sie, dass sie die Koordinaten wie &quot; &lt;&lt; endl;
          cout &lt;&lt; &quot;folgt eingeben m&quot; &lt;&lt; Zeichen::ue &lt;&lt; &quot;ssen, da sie sonst nicht erkannt werden\n&quot;;
          cout &lt;&lt; &quot;z.B. Berlin (52&quot; &lt;&lt; Zeichen::gr &lt;&lt; &quot;23\' 0\'\' N, 13&quot; &lt;&lt; 
          Zeichen::gr &lt;&lt; &quot;31\' 47\'\' O ): 52 23 0 N 13 47 O&quot; &lt;&lt; endl;
          cin &gt;&gt;koords-&gt;lg &gt;&gt; koords-&gt;lm &gt;&gt; koords-&gt;ls &gt;&gt; koords-&gt;lae &gt;&gt;
          koords-&gt;bg &gt;&gt; koords-&gt;bm &gt;&gt; koords-&gt;bs &gt;&gt; koords-&gt;bre;
          }
     switch ( qqq ) {
            case 0: cout &lt;&lt; &quot;Okay, der Flughafen wurde erkannt, die&quot; &lt;&lt; endl;
                    cout &lt;&lt; &quot;Koordinaten wurden eingesetzt.&quot; &lt;&lt; endl;
                    break;
            case 1: cout &lt;&lt; &quot;OK, die Koordinaten wurden eingesetzt.&quot; &lt;&lt; endl;
                    break; 
            }
     }
</code></pre>
<p>Ich hab die anderen Flughäfen rausgelassen, sie sind genaus aufgebaut wie Frankfurt.</p>
<p>Ich bekomme keine Fehlermeldung, aber wenn ich der Funktion &quot;Frankfurt&quot; oder &quot;EDDF&quot; übergebe,<br />
erkennt diese es nicht und ich komme zu dem else-Block, um die Koordinaten per Hand nachzutragen.</p>
<p>Kann mir da jemand helfen ???</p>
<p>PS: Die Funktion mit den Punkten tut da nichts zur sache.</p>
<p>Danke schon mal im Voraus, Tim</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/237212/char-von-if-nicht-erkannt</link><generator>RSS for Node</generator><lastBuildDate>Wed, 23 Sep 2026 06:23:05 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/237212.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 25 Mar 2009 19:39:15 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to char* von if nicht erkannt on Wed, 25 Mar 2009 19:39:34 GMT]]></title><description><![CDATA[<p>Hallo alle zusammen,</p>
<p>Ich will ein Programm schreiben, das manche Flughäfen erkennt und dafür die richtigen<br />
Koordinaten einsetzt, wenn es sie kennt. Sonst soll ein else-Block aufgerufen werden, um<br />
die Koordinaten per Hand einzutragen. Hier der Header und die Implementierung:</p>
<p>Header:</p>
<pre><code class="language-cpp">#ifndef EIGEN_H
#define EIGEN_H

#include &lt;windows.h&gt;
#include &lt;iostream&gt;

namespace Zeichen
    {
        const unsigned char AE = static_cast&lt;unsigned char&gt;(142);
        const unsigned char ae = static_cast&lt;unsigned char&gt;(132);
        const unsigned char OE = static_cast&lt;unsigned char&gt;(153);
        const unsigned char oe = static_cast&lt;unsigned char&gt;(148);
        const unsigned char UE = static_cast&lt;unsigned char&gt;(154);
        const unsigned char ue = static_cast&lt;unsigned char&gt;(129);
        const unsigned char ss = static_cast&lt;unsigned char&gt;(225);
        const unsigned char gr = static_cast&lt;unsigned char&gt;(248);
    }

struct koord {
           int lg;
           int lm;
           int ls;
           char lae;
           int bg;
           int bm;
           int bs;
           char bre;
    };

void punkte (int, int=500);

void einfuegen (char *, koord* );

#endif
</code></pre>
<p>Die Implementierung:</p>
<pre><code class="language-cpp">#include &quot;eigen.h&quot;
using namespace std;
void punkte( int a,int b) {
     for(int i=0; i &lt;= a; i++) {
             cout &lt;&lt; &quot;.&quot; &lt;&lt; flush;
             Sleep ( b );
             }
     }

void einfuegen (char* a, koord* koords) {
     int qqq=0;
     if (a == &quot;Frankfurt&quot; || a == &quot;EDDF&quot; || a == &quot;eddf&quot; || a == &quot;FRA&quot; ||
        a == &quot;fra&quot; || a == &quot;frankfurt&quot; || a == &quot;FRANKFURT&quot;) {
          a = &quot;Frankfurt&quot;;
          koords-&gt;lg=50;koords-&gt;lm=1;koords-&gt;lae='N';koords-&gt;bg=8;
          koords-&gt;bm=32;koords-&gt;bre='O';koords-&gt;ls=35;koords-&gt;bs=35;
          }
     else { qqq = 1;
          cout &lt;&lt; &quot;Leider ist &quot; &lt;&lt; a &lt;&lt; &quot; in der Datenbank des &quot; &lt;&lt; endl;
          cout &lt;&lt; &quot;Programms nicht vorhanden. Bitte geben sie die &quot; &lt;&lt; endl;
          cout &lt;&lt; &quot;Koordinaten von &quot; &lt;&lt; a &lt;&lt; &quot; ein.\n&quot; &lt;&lt; endl;
          cout &lt;&lt; &quot;Bitte beachen sie, dass sie die Koordinaten wie &quot; &lt;&lt; endl;
          cout &lt;&lt; &quot;folgt eingeben m&quot; &lt;&lt; Zeichen::ue &lt;&lt; &quot;ssen, da sie sonst nicht erkannt werden\n&quot;;
          cout &lt;&lt; &quot;z.B. Berlin (52&quot; &lt;&lt; Zeichen::gr &lt;&lt; &quot;23\' 0\'\' N, 13&quot; &lt;&lt; 
          Zeichen::gr &lt;&lt; &quot;31\' 47\'\' O ): 52 23 0 N 13 47 O&quot; &lt;&lt; endl;
          cin &gt;&gt;koords-&gt;lg &gt;&gt; koords-&gt;lm &gt;&gt; koords-&gt;ls &gt;&gt; koords-&gt;lae &gt;&gt;
          koords-&gt;bg &gt;&gt; koords-&gt;bm &gt;&gt; koords-&gt;bs &gt;&gt; koords-&gt;bre;
          }
     switch ( qqq ) {
            case 0: cout &lt;&lt; &quot;Okay, der Flughafen wurde erkannt, die&quot; &lt;&lt; endl;
                    cout &lt;&lt; &quot;Koordinaten wurden eingesetzt.&quot; &lt;&lt; endl;
                    break;
            case 1: cout &lt;&lt; &quot;OK, die Koordinaten wurden eingesetzt.&quot; &lt;&lt; endl;
                    break; 
            }
     }
</code></pre>
<p>Ich hab die anderen Flughäfen rausgelassen, sie sind genaus aufgebaut wie Frankfurt.</p>
<p>Ich bekomme keine Fehlermeldung, aber wenn ich der Funktion &quot;Frankfurt&quot; oder &quot;EDDF&quot; übergebe,<br />
erkennt diese es nicht und ich komme zu dem else-Block, um die Koordinaten per Hand nachzutragen.</p>
<p>Kann mir da jemand helfen ???</p>
<p>PS: Die Funktion mit den Punkten tut da nichts zur sache.</p>
<p>Danke schon mal im Voraus, Tim</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1686023</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1686023</guid><dc:creator><![CDATA[Tim1995]]></dc:creator><pubDate>Wed, 25 Mar 2009 19:39:34 GMT</pubDate></item><item><title><![CDATA[Reply to char* von if nicht erkannt on Wed, 25 Mar 2009 19:45:18 GMT]]></title><description><![CDATA[<p>nimm std::string statt char*.<br />
<a href="http://www.cplusplus.com/reference/string/string/" rel="nofollow">http://www.cplusplus.com/reference/string/string/</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1686025</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1686025</guid><dc:creator><![CDATA[highlevel]]></dc:creator><pubDate>Wed, 25 Mar 2009 19:45:18 GMT</pubDate></item><item><title><![CDATA[Reply to char* von if nicht erkannt on Wed, 25 Mar 2009 19:47:23 GMT]]></title><description><![CDATA[<p>Du kannst ein <code>char *</code> nicht mit <code>==</code> vergleichen! Du musst stattdessen mit strcmp arbeiten:<br />
<a href="http://www.cplusplus.com/reference/clibrary/cstring/strcmp.html" rel="nofollow">http://www.cplusplus.com/reference/clibrary/cstring/strcmp.html</a></p>
<p>Oder du machst es dir einfacher und wählst den in C++ üblichen weg, d.h. du benutzt anstatt <code>char *</code> std::string.<br />
Dann kannst du auch wieder mit <code>==</code> arbeiten und sparst dir eine menge Ärger...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1686028</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1686028</guid><dc:creator><![CDATA[BBB]]></dc:creator><pubDate>Wed, 25 Mar 2009 19:47:23 GMT</pubDate></item><item><title><![CDATA[Reply to char* von if nicht erkannt on Thu, 26 Mar 2009 16:35:57 GMT]]></title><description><![CDATA[<p>ok, danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1686463</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1686463</guid><dc:creator><![CDATA[Tim1995]]></dc:creator><pubDate>Thu, 26 Mar 2009 16:35:57 GMT</pubDate></item><item><title><![CDATA[Reply to char* von if nicht erkannt on Thu, 26 Mar 2009 17:24:12 GMT]]></title><description><![CDATA[<p>So, ich habs jetzt ma so gemacht:</p>
<p>Header:</p>
<pre><code class="language-cpp">//...
void einfuegen (string *, koord* );
//...
</code></pre>
<p>Implementierung:</p>
<pre><code class="language-cpp">void einfuegen (string * a, koord* koords) {
     int qqq=0;
     if (*a == &quot;Frankfurt&quot; || *a == &quot;EDDF&quot; || *a == &quot;eddf&quot; || *a == &quot;FRA&quot; ||
        *a == &quot;fra&quot; || *a == &quot;frankfurt&quot; || *a == &quot;FRANKFURT&quot;) {
          *a = &quot;Frankfurt&quot;;
          koords-&gt;lg=50;koords-&gt;lm=1;koords-&gt;lae='N';koords-&gt;bg=8;
          koords-&gt;bm=32;koords-&gt;bre='O';koords-&gt;ls=35;koords-&gt;bs=35;
          }
//usw
}
</code></pre>
<p>Ich bekomme die folgende Fehlermeldung (im Header )</p>
<pre><code>eigen.h: variable or field `einfuegen' declared void
eigen.h:`string' was not declared in this scope
(Hauptprog)haupt.cpp:`einfuegen' cannot be used as a function
</code></pre>
<p>Ich habe den Header cstring eingebunden.</p>
<p>mfg,</p>
<p>Tim</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1686489</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1686489</guid><dc:creator><![CDATA[Tim1995]]></dc:creator><pubDate>Thu, 26 Mar 2009 17:24:12 GMT</pubDate></item><item><title><![CDATA[Reply to char* von if nicht erkannt on Thu, 26 Mar 2009 17:28:09 GMT]]></title><description><![CDATA[<p>Du brauchst &lt;string&gt;<br />
und dann wird ein string mit std::string deklariert</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1686492</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1686492</guid><dc:creator><![CDATA[Tobias Gerg]]></dc:creator><pubDate>Thu, 26 Mar 2009 17:28:09 GMT</pubDate></item><item><title><![CDATA[Reply to char* von if nicht erkannt on Thu, 26 Mar 2009 17:39:03 GMT]]></title><description><![CDATA[<p>geht net, ich bekomme die gleiche Fehlermeldung wie oben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1686496</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1686496</guid><dc:creator><![CDATA[Tim1995]]></dc:creator><pubDate>Thu, 26 Mar 2009 17:39:03 GMT</pubDate></item><item><title><![CDATA[Reply to char* von if nicht erkannt on Thu, 26 Mar 2009 18:37:31 GMT]]></title><description><![CDATA[<p>Bist du sicher, dass du <code>&lt;string&gt;</code> zuvor inkludiert hast <strong>und</strong> den Namensraum angibst? Gib doch nochmals den jetzigen Code und die passende Fehlermeldung an.</p>
<p>Ausserdem würde ich den <code>std::string</code> eher als Const-Referenz als als Zeiger übergeben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1686527</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1686527</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Thu, 26 Mar 2009 18:37:31 GMT</pubDate></item><item><title><![CDATA[Reply to char* von if nicht erkannt on Sun, 29 Mar 2009 13:59:22 GMT]]></title><description><![CDATA[<p>ok, danke, das klappt soweit wieder, ich bekomme keine fehlermeldung.<br />
allerding wird mein der funktion übergebener Flughafen wieder nicht erkannt.<br />
ich hab einfach std:: davorgesetzt.</p>
<p>Header:</p>
<pre><code class="language-cpp">//...
void einfuegen (std::string *, koord* );
//...
</code></pre>
<p>Implementierung:</p>
<pre><code class="language-cpp">//...
void einfuegen (std::string * a, koord* koords) {
     int qqq=0;
     if (*a == &quot;Frankfurt&quot; || *a == &quot;EDDF&quot; || *a == &quot;eddf&quot; || *a == &quot;FRA&quot; ||
        *a == &quot;fra&quot; || *a == &quot;frankfurt&quot; || *a == &quot;FRANKFURT&quot;) {
          *a = &quot;Frankfurt&quot;;
          koords-&gt;lg=50;koords-&gt;lm=1;koords-&gt;lae='N';koords-&gt;bg=8;
          koords-&gt;bm=32;koords-&gt;bre='O';koords-&gt;ls=35;koords-&gt;bs=35;
          }
//...
}
</code></pre>
<p>Funktionsaufruf mit</p>
<pre><code class="language-cpp">einfuegen ( &amp;start, &amp;koords );
</code></pre>
<p>start ist ein vorher eingegebener string.</p>
<p>Mein if erkennt wieder &quot;Frankfurt&quot; nicht und ich komme zum else-block.</p>
<p>mfg<br />
Tim</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1687795</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1687795</guid><dc:creator><![CDATA[Tim1995]]></dc:creator><pubDate>Sun, 29 Mar 2009 13:59:22 GMT</pubDate></item><item><title><![CDATA[Reply to char* von if nicht erkannt on Sun, 29 Mar 2009 14:03:18 GMT]]></title><description><![CDATA[<p>Warum machst du das da überhaupt mit Zeigern? - Du kannst ja auch einen normalen (ev. const) string übergeben. Ist üblicher, als da etwas mit Zeiger zu machen. Vor allem ist der Aufruf auch intuitiver.</p>
<p>Der gegebene Code sollte allerdings funktionieren. Also wird etwas beim Aufruf schief gehen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1687796</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1687796</guid><dc:creator><![CDATA[drakon]]></dc:creator><pubDate>Sun, 29 Mar 2009 14:03:18 GMT</pubDate></item><item><title><![CDATA[Reply to char* von if nicht erkannt on Sun, 29 Mar 2009 14:11:38 GMT]]></title><description><![CDATA[<p>ok. ich habs jetzt nochma mit einer const std::string &amp; probiert.</p>
<p>Header:</p>
<pre><code class="language-cpp">//...
void einfuegen (const std::string &amp;, koord* );
//...
</code></pre>
<p>Implementierung:</p>
<pre><code class="language-cpp">//...
void einfuegen (const std::string &amp; a, koord* koords) {
     int qqq=0;
     if (a == &quot;Frankfurt&quot; || a == &quot;EDDF&quot; || a == &quot;eddf&quot; || a == &quot;FRA&quot; ||
        a == &quot;fra&quot; ||a == &quot;frankfurt&quot; || a == &quot;FRANKFURT&quot;) {
          a = &quot;Frankfurt&quot;;
          koords-&gt;lg=50;koords-&gt;lm=1;koords-&gt;lae='N';koords-&gt;bg=8;
          koords-&gt;bm=32;koords-&gt;bre='O';koords-&gt;ls=35;koords-&gt;bs=35;
          }
//...
}
</code></pre>
<p>Aufruf mit:</p>
<pre><code class="language-cpp">einfuegen ( rstart, &amp;koords );
</code></pre>
<p>rstart ist:</p>
<pre><code class="language-cpp">const string &amp; rstart=start;
</code></pre>
<p>Leider bekomme ich jetzt folgende Fehlermeldung:</p>
<pre><code>passing `const std::string' as `this' argument of `std::basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp; std::basic_string&lt;_CharT, _Traits, _Alloc&gt;::operator=(const _CharT*) [with _CharT = char, _Traits = std::char_traits&lt;char&gt;, _Alloc = std::allocator&lt;char&gt;]' discards qualifiers
</code></pre>
<p>und zwar genauso oft, wie ich</p>
<pre><code>a = &quot;Frankfurt&quot;;
</code></pre>
<p>verwendet habe. Hier liegt auch die Fehlerzeile.</p>
<p>Jetzt blick ich überhaupt nicht mehr durch.</p>
<p>mfg</p>
<p>Tim</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1687798</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1687798</guid><dc:creator><![CDATA[Tim1995]]></dc:creator><pubDate>Sun, 29 Mar 2009 14:11:38 GMT</pubDate></item><item><title><![CDATA[Reply to char* von if nicht erkannt on Sun, 29 Mar 2009 14:13:40 GMT]]></title><description><![CDATA[<p>an drakon:</p>
<p>ich mach des ganze mit zeigern, weil ich den wert ändern will, so dass, wenn man z.B. frankfurt eingibt, die Funktion die richtige Rechtschreibung einsetzt.</p>
<p>mfg</p>
<p>Tim</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1687799</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1687799</guid><dc:creator><![CDATA[Tim1995]]></dc:creator><pubDate>Sun, 29 Mar 2009 14:13:40 GMT</pubDate></item><item><title><![CDATA[Reply to char* von if nicht erkannt on Sun, 29 Mar 2009 14:13:56 GMT]]></title><description><![CDATA[<p><strong>const</strong> paßt leider vorläufig nicht zu deinem entwurf.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1687800</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1687800</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Sun, 29 Mar 2009 14:13:56 GMT</pubDate></item><item><title><![CDATA[Reply to char* von if nicht erkannt on Sun, 29 Mar 2009 14:15:07 GMT]]></title><description><![CDATA[<p>Tim1995 schrieb:</p>
<blockquote>
<p>ich mach des ganze mit zeigern, weil ich den wert ändern will, so dass, wenn man z.B. frankfurt eingibt, die Funktion die richtige Rechtschreibung einsetzt.</p>
</blockquote>
<p>Dafür kannst du auch (Non-Const-)Referenzen einsetzen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1687802</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1687802</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Sun, 29 Mar 2009 14:15:07 GMT</pubDate></item><item><title><![CDATA[Reply to char* von if nicht erkannt on Sun, 29 Mar 2009 14:24:21 GMT]]></title><description><![CDATA[<p>OK.</p>
<p>Ich hab des const weggemacht.</p>
<p>Das if erkennt immer noch nicht FRA.</p>
<p>Vielleicht ist die Eingabe irgendwie net ok ?</p>
<p>ich mach das so:</p>
<pre><code class="language-cpp">cin &gt;&gt; start;
einfuegen ( rstart, &amp;koords );
</code></pre>
<p>mfg</p>
<p>Tim <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/1f621.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--pouting_face"
      title=":rage:"
      alt="😡"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1687807</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1687807</guid><dc:creator><![CDATA[Tim1995]]></dc:creator><pubDate>Sun, 29 Mar 2009 14:24:21 GMT</pubDate></item><item><title><![CDATA[Reply to char* von if nicht erkannt on Sun, 29 Mar 2009 14:30:31 GMT]]></title><description><![CDATA[<p>Tim1995 schrieb:</p>
<blockquote>
<p>Vielleicht ist die Eingabe irgendwie net ok ?<br />
ich mach das so:</p>
<pre><code class="language-cpp">cin &gt;&gt; start;
einfuegen ( rstart, &amp;koords );
</code></pre>
</blockquote>
<p>dein erkennungscode ist ok.</p>
<p>aber warum tust du start einlesen und rstart übergeben?</p>
<p>wenn es wirklich start und rstart geben soll, dann entweder</p>
<pre><code class="language-cpp">cin &gt;&gt; start;
string rstart=start;
einfuegen ( rstart, &amp;koords );
</code></pre>
<p>oder besser</p>
<pre><code class="language-cpp">cin &gt;&gt; start;
string rstart=einfuegen ( rstart, &amp;koords );
</code></pre>
<p>aber super hübsch isses noch net, weil du dummerweise 2 rückgabewerte hast.</p>
<p>perfekt wäre ne struktur aus name und koordinaten, glaub ich.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1687808</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1687808</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Sun, 29 Mar 2009 14:30:31 GMT</pubDate></item><item><title><![CDATA[Reply to char* von if nicht erkannt on Sun, 29 Mar 2009 14:51:46 GMT]]></title><description><![CDATA[<p>OK. Nach Idee von volkard ganz neue Art.<br />
Sie klappt!!!! Endlich!!!</p>
<p>Header:</p>
<pre><code class="language-cpp">//...
koord einfuegen ( koord );
//...
</code></pre>
<p>Implementierung:</p>
<pre><code class="language-cpp">koord einfuegen (koord koords) {
     int qqq=0;
     koord rueck;
     if (koords.name == &quot;Frankfurt&quot; || koords.name == &quot;EDDF&quot; || 
        koords.name == &quot;eddf&quot; || koords.name == &quot;FRA&quot; ||
        koords.name == &quot;fra&quot; || koords.name == &quot;frankfurt&quot; || 
        koords.name == &quot;FRANKFURT&quot;) {
          rueck.name = &quot;Frankfurt&quot;;
          rueck.lg=50;rueck.lm=1;rueck.lae='N';rueck.bg=8;
          rueck.bm=32;rueck.bre='O';rueck.ls=35;rueck.bs=35;
          }
//...
}
</code></pre>
<p>Aufruf mit:</p>
<pre><code class="language-cpp">koords=einfuegen ( koords );
</code></pre>
<p>Vielen Dank euch allen.</p>
<p>Tim <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/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1687815</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1687815</guid><dc:creator><![CDATA[Tim1995]]></dc:creator><pubDate>Sun, 29 Mar 2009 14:51:46 GMT</pubDate></item><item><title><![CDATA[Reply to char* von if nicht erkannt on Sun, 29 Mar 2009 15:27:41 GMT]]></title><description><![CDATA[<p>Um das ganze etwas schöne zu gestalten würde ich die Eingabe einfach auf lower case umwandeln und dann überprüfen. (sofern das innerhalb des Namens ebenfalls erlaubt sein soll; ansonsten könntest du auch nur den ersten Buchstaben umwandeln)</p>
<p><a href="http://www.cplusplus.com/reference/clibrary/cctype/tolower.html" rel="nofollow">http://www.cplusplus.com/reference/clibrary/cctype/tolower.html</a></p>
<p>Und dann würde ich da noch ein wenig auf die Einrückung achten. Klammern sollten immer zu einem Block gehören, welchen man erkennen sollte.</p>
<p>z.B so:</p>
<pre><code class="language-cpp">if ( blabla ){
    ...
}
</code></pre>
<p>oder</p>
<pre><code class="language-cpp">if ( blabla )
{
    ...
}
</code></pre>
<p>aber sicher nicht:</p>
<pre><code class="language-cpp">if ( blabla ){
   ...
   }
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1687830</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1687830</guid><dc:creator><![CDATA[drakon]]></dc:creator><pubDate>Sun, 29 Mar 2009 15:27:41 GMT</pubDate></item><item><title><![CDATA[Reply to char* von if nicht erkannt on Sun, 29 Mar 2009 15:37:06 GMT]]></title><description><![CDATA[<p>ich habs eben nur nit einem if probiert.<br />
Wenn ich jetzt z.B. London dazunehme, gehts wieder nicht und der Flughafen wird wieder ncicht erkannt.</p>
<pre><code class="language-cpp">koord einfuegen (koord koords) {
     int qqq=0;
     koord rueck;
     if (koords.name == &quot;Frankfurt&quot; || koords.name == &quot;EDDF&quot; || 
        koords.name == &quot;eddf&quot; || koords.name == &quot;FRA&quot; ||
        koords.name == &quot;fra&quot; || koords.name == &quot;frankfurt&quot; || 
        koords.name == &quot;FRANKFURT&quot;) {
          rueck.name = &quot;Frankfurt&quot;;
          rueck.lg=50;rueck.lm=1;rueck.lae='N';rueck.bg=8;
          rueck.bm=32;rueck.bre='O';rueck.ls=35;rueck.bs=35;
          }
     if ( koords.name == &quot;London&quot; || koords.name == &quot;london&quot; || 
        koords.name == &quot;EGLL&quot; || koords.name == &quot;egll&quot; || 
        koords.name == &quot;LHR&quot; || koords.name == &quot;lhr&quot; || 
        koords.name == &quot;LONDON&quot; ) {
          rueck.name = &quot;London&quot;;
          rueck.lg=51;rueck.lm=28;rueck.lae='N';rueck.bg=0;
          rueck.bm=27;rueck.bre='W';rueck.ls=39;rueck.bs=41;
          }
//..
}
</code></pre>
<p>um hilfe wird gebeten,</p>
<p>Tim</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1687832</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1687832</guid><dc:creator><![CDATA[Tim1995]]></dc:creator><pubDate>Sun, 29 Mar 2009 15:37:06 GMT</pubDate></item><item><title><![CDATA[Reply to char* von if nicht erkannt on Sun, 29 Mar 2009 15:43:06 GMT]]></title><description><![CDATA[<p>Schau doch mit dem Debugger, ob die Werte innerhalb der Funktion dem entsprechen, was du erwartest. Dann findest du schnell heraus, wo es happert.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1687835</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1687835</guid><dc:creator><![CDATA[drakon]]></dc:creator><pubDate>Sun, 29 Mar 2009 15:43:06 GMT</pubDate></item><item><title><![CDATA[Reply to char* von if nicht erkannt on Sun, 29 Mar 2009 15:53:26 GMT]]></title><description><![CDATA[<p>ganz blöde frage, aber wie mache ich das mit dev-c++ ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1687838</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1687838</guid><dc:creator><![CDATA[Tim1995]]></dc:creator><pubDate>Sun, 29 Mar 2009 15:53:26 GMT</pubDate></item><item><title><![CDATA[Reply to char* von if nicht erkannt on Sun, 29 Mar 2009 16:13:53 GMT]]></title><description><![CDATA[<p>Tim1995 schrieb:</p>
<blockquote>
<p>ganz blöde frage, aber wie mache ich das mit dev-c++ ?</p>
</blockquote>
<p>Lies die Anleitung deiner Entwicklungsumgebung. Und wenn du dir wirklich einen gefallen tun willst: Ersetze sie! (die Entwicklung von DevC++ ist eingestellt; alternativen wären z.B. die beiden kostenlosen IDEs Microsoft Visual C++ Express 2008 oder Code::Blocks).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1687845</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1687845</guid><dc:creator><![CDATA[asc]]></dc:creator><pubDate>Sun, 29 Mar 2009 16:13:53 GMT</pubDate></item><item><title><![CDATA[Reply to char* von if nicht erkannt on Sun, 29 Mar 2009 17:32:31 GMT]]></title><description><![CDATA[<p>immer, wenn das ergebnis feststeht, sofort return machen, dann werden die else-geschichten ein wenig entschärft.</p>
<pre><code class="language-cpp">koord einfuegen (koord koords) {
     int qqq=0;
     koord rueck;
     if (koords.name == &quot;Frankfurt&quot; || koords.name == &quot;EDDF&quot; || 
        koords.name == &quot;eddf&quot; || koords.name == &quot;FRA&quot; ||
        koords.name == &quot;fra&quot; || koords.name == &quot;frankfurt&quot; || 
        koords.name == &quot;FRANKFURT&quot;) {
          rueck.name = &quot;Frankfurt&quot;;
          rueck.lg=50;rueck.lm=1;rueck.lae='N';rueck.bg=8;
          rueck.bm=32;rueck.bre='O';rueck.ls=35;rueck.bs=35;
          return;
          }
     if ( koords.name == &quot;London&quot; || koords.name == &quot;london&quot; || 
        koords.name == &quot;EGLL&quot; || koords.name == &quot;egll&quot; || 
        koords.name == &quot;LHR&quot; || koords.name == &quot;lhr&quot; || 
        koords.name == &quot;LONDON&quot; ) {
          rueck.name = &quot;London&quot;;
          rueck.lg=51;rueck.lm=28;rueck.lae='N';rueck.bg=0;
          rueck.bm=27;rueck.bre='W';rueck.ls=39;rueck.bs=41;
          return;
          }
//..
   //kram machen, der zu machen ist, wenn nix erkannt wurde. 
}
</code></pre>
<p>und geh echt von DevC++ weg.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1687885</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1687885</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Sun, 29 Mar 2009 17:32:31 GMT</pubDate></item><item><title><![CDATA[Reply to char* von if nicht erkannt on Sun, 29 Mar 2009 18:08:32 GMT]]></title><description><![CDATA[<p>Die Sache sähe ein wenig übersichtlicher aus, wenn man die Namen in einem Array speichern würde und dann per Schleife prüft. Am besten in einer eigenen Funktion...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1687901</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1687901</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Sun, 29 Mar 2009 18:08:32 GMT</pubDate></item><item><title><![CDATA[Reply to char* von if nicht erkannt on Thu, 02 Apr 2009 15:16:07 GMT]]></title><description><![CDATA[<p>jetzt gehts. ich musst else if statt nur if nehmen.</p>
<p>mfg</p>
<p>Tim</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1689953</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1689953</guid><dc:creator><![CDATA[Tim1995]]></dc:creator><pubDate>Thu, 02 Apr 2009 15:16:07 GMT</pubDate></item></channel></rss>