<?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[Vergleich schlägt fehl]]></title><description><![CDATA[<pre><code class="language-cpp">if(finddata.cFileName == &quot;80040A_NA2009_ENUS_IC.zip&quot;)//finddata.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY &amp;&amp;
</code></pre>
<pre><code class="language-cpp">WIN32_FIND_DATA finddata;
</code></pre>
<p>Hallo,</p>
<p>ich überpfüfe auf eine FTP Laufwerk ob es eine bestimmte Datei gibt. Ich weiß ganz genau, dass es die Datei gibt mit der verglichen wird da ich sie aus Testzwecken extra erstellt habe. Allerding wird nie das IF ausgeführt. Woran kann es liegen?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/244634/vergleich-schlägt-fehl</link><generator>RSS for Node</generator><lastBuildDate>Sat, 19 Sep 2026 09:49:29 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/244634.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 03 Jul 2009 08:33:33 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Vergleich schlägt fehl on Fri, 03 Jul 2009 08:33:33 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">if(finddata.cFileName == &quot;80040A_NA2009_ENUS_IC.zip&quot;)//finddata.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY &amp;&amp;
</code></pre>
<pre><code class="language-cpp">WIN32_FIND_DATA finddata;
</code></pre>
<p>Hallo,</p>
<p>ich überpfüfe auf eine FTP Laufwerk ob es eine bestimmte Datei gibt. Ich weiß ganz genau, dass es die Datei gibt mit der verglichen wird da ich sie aus Testzwecken extra erstellt habe. Allerding wird nie das IF ausgeführt. Woran kann es liegen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1736440</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1736440</guid><dc:creator><![CDATA[secondsun]]></dc:creator><pubDate>Fri, 03 Jul 2009 08:33:33 GMT</pubDate></item><item><title><![CDATA[Reply to Vergleich schlägt fehl on Fri, 03 Jul 2009 08:41:51 GMT]]></title><description><![CDATA[<p>Ich tipp mal drauf, dass cFileName kein string, sondern ein TCHAR[] ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1736442</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1736442</guid><dc:creator><![CDATA[bgdnoy]]></dc:creator><pubDate>Fri, 03 Jul 2009 08:41:51 GMT</pubDate></item><item><title><![CDATA[Reply to Vergleich schlägt fehl on Fri, 03 Jul 2009 08:52:36 GMT]]></title><description><![CDATA[<p>Du könntest z.B. strcmp/strncmp benutzen. Oder erst mal nach std::string umwandeln...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1736449</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1736449</guid><dc:creator><![CDATA[_matze]]></dc:creator><pubDate>Fri, 03 Jul 2009 08:52:36 GMT</pubDate></item><item><title><![CDATA[Reply to Vergleich schlägt fehl on Fri, 03 Jul 2009 08:58:24 GMT]]></title><description><![CDATA[<p>danke erstmal euch beiden. Es ist TCHAR und ich habe es jetzt mit strncmp gelöst;-)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1736454</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1736454</guid><dc:creator><![CDATA[secondsun]]></dc:creator><pubDate>Fri, 03 Jul 2009 08:58:24 GMT</pubDate></item><item><title><![CDATA[Reply to Vergleich schlägt fehl on Fri, 03 Jul 2009 09:59:41 GMT]]></title><description><![CDATA[<blockquote>
<p>Es ist TCHAR und ich habe es jetzt mit strncmp gelöst;-)</p>
</blockquote>
<p>Aber Vorsicht!<br />
TCHAR ist ein Typ, der je nach Laune der Windows-Version entweder 1-Byte-Zeichen oder Mehr-Byte-Zeichen verwendet. Und bei bei Mehr-Byte-Zeichen können vor dem Ende eines Strings Nullbytes auftauchen.</p>
<p>Deshalb bietet Windows eine Funktion <code>lstrcmp</code> , die mit Zeigern auf TCHAR arbeitet.<br />
Dein Code funktioniert vielleicht auch mit <code>strcmp</code> , aber das ist nicht für alle Windows-Versionen garantiert.</p>
<p>Portabel wäre:</p>
<pre><code class="language-cpp">lstrcmp(finddata.cFileName, TEXT(&quot;80040A_NA2009_ENUS_IC.zip&quot;))
// statt
strcmp(finddata.cFileName, &quot;80040A_NA2009_ENUS_IC.zip&quot;)
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1736489</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1736489</guid><dc:creator><![CDATA[bgdnoy]]></dc:creator><pubDate>Fri, 03 Jul 2009 09:59:41 GMT</pubDate></item><item><title><![CDATA[Reply to Vergleich schlägt fehl on Fri, 03 Jul 2009 11:24:27 GMT]]></title><description><![CDATA[<p>Aha...hmm..also das Problem sollte natürlich nicht auftreten;-)</p>
<p>also ist &quot;lstrcmp&quot; auch besser als &quot;strncmp&quot;?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1736550</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1736550</guid><dc:creator><![CDATA[secondsun]]></dc:creator><pubDate>Fri, 03 Jul 2009 11:24:27 GMT</pubDate></item><item><title><![CDATA[Reply to Vergleich schlägt fehl on Fri, 03 Jul 2009 11:37:11 GMT]]></title><description><![CDATA[<p>secondsun schrieb:</p>
<blockquote>
<p>also ist &quot;lstrcmp&quot; auch besser als &quot;strncmp&quot;?</p>
</blockquote>
<p>Ich gehe mal auf den Vergleich der Familien (lstr*** und str***) ein, nicht darauf, dass es zwischen (l)strcmp und (l)str<strong>n</strong>cmp auch noch funktionale Unterschiede gibt.</p>
<p>Wenn Du char-Zeichenketten vergleichen willst, ist lstrcmp nicht &quot;besser&quot;, sondern schlicht und ergreifend falsch. Dummerweise würde es, wenn Du Programme im ANSI-Modus übersetzt, sogar funktionieren.</p>
<p>Wenn Du TCHAR-Zeichenketten vergleichen willst, ist strcmp falsch. Dummerweise würde es, wenn Du Programme im ANSI-Modus übersetzt, sogar funktionieren.</p>
<p>Du siehst: &quot;Besser&quot; ist, was für den konkreten Fall geeignet ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1736560</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1736560</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Fri, 03 Jul 2009 11:37:11 GMT</pubDate></item><item><title><![CDATA[Reply to Vergleich schlägt fehl on Fri, 03 Jul 2009 11:48:13 GMT]]></title><description><![CDATA[<p>okay...danke;-)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1736566</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1736566</guid><dc:creator><![CDATA[secondsun]]></dc:creator><pubDate>Fri, 03 Jul 2009 11:48:13 GMT</pubDate></item><item><title><![CDATA[Reply to Vergleich schlägt fehl on Fri, 03 Jul 2009 12:10:28 GMT]]></title><description><![CDATA[<p>Für TCHAR gibts aus tchar.h Routinen:<br />
<a href="http://msdn.microsoft.com/en-us/library/e0z9k731.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/e0z9k731.aspx</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1736583</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1736583</guid><dc:creator><![CDATA[theta]]></dc:creator><pubDate>Fri, 03 Jul 2009 12:10:28 GMT</pubDate></item></channel></rss>