<?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[strdup ist deprecated]]></title><description><![CDATA[<p>Hallo,</p>
<p>Mein VS2005 sagt mir, dass strdup deprecated ist.<br />
Benutze es um von einem std::string(.c_str()) einen char* für eine C-Api Funktion zu bekommen. Gibt es da einen besseren Weg?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/177231/strdup-ist-deprecated</link><generator>RSS for Node</generator><lastBuildDate>Sat, 19 Sep 2026 22:19:03 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/177231.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 29 Mar 2007 11:53:59 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to strdup ist deprecated on Thu, 29 Mar 2007 11:53:59 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Mein VS2005 sagt mir, dass strdup deprecated ist.<br />
Benutze es um von einem std::string(.c_str()) einen char* für eine C-Api Funktion zu bekommen. Gibt es da einen besseren Weg?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1255260</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1255260</guid><dc:creator><![CDATA[templäd]]></dc:creator><pubDate>Thu, 29 Mar 2007 11:53:59 GMT</pubDate></item><item><title><![CDATA[Reply to strdup ist deprecated on Thu, 29 Mar 2007 12:04:49 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Vermutlich <a href="http://refspecs.freestandards.org/LSB_3.0.0/LSB-Core-generic/LSB-Core-generic/baselib-strndup.html" rel="nofollow">strndup</a>.<br />
Allerdings dürfet beides nicht aus dem C/C++ Standard sein (zumindestens finde ich es nicht <a href="http://www.cppreference.com/" rel="nofollow">hier</a>)</p>
<p>Ansonsten kannst du auch einfach direkt den Rückgabewert von c_str() benutzen. Wenn die API auf nicht-const besteht, du dir aber sicher bist das die Funktion nicht den C-String verändern wird mach einfach ein const_cast.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1255268</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1255268</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Thu, 29 Mar 2007 12:04:49 GMT</pubDate></item><item><title><![CDATA[Reply to strdup ist deprecated on Thu, 29 Mar 2007 12:26:52 GMT]]></title><description><![CDATA[<p>Am besten Du definierst _CRT_SECURE_NO_DEPRECATE als Präprozessor-Konstante und ignorierst diese Anmaßung Microsofts ansonsten, bis jemand diese Funktion tatsächlich für veraltet erklärt.</p>
<p>Ansonsten ist die Funktion wirklich kein ANSI-C, sondern BSD. Strndup ist sogar eine GNU-Extension (laut Manpage), deshalb bei VS2005 auch nicht zu finden. Allein deshalb ist es in meinen Augen gleich doppelt dreist von Microsoft, strdup für veraltet zu erklären.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1255291</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1255291</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Thu, 29 Mar 2007 12:26:52 GMT</pubDate></item><item><title><![CDATA[Reply to strdup ist deprecated on Thu, 29 Mar 2007 13:27:31 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/10648">@LordJaxom</a><br />
Vllt. solltest du in deinem Wörterbuch nochmal nachschauen, was <em>deprecated</em> heisst, bevor du Microsoft Dreistigkeit unterstellst. <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>
]]></description><link>https://www.c-plusplus.net/forum/post/1255345</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1255345</guid><dc:creator><![CDATA[groovemaster]]></dc:creator><pubDate>Thu, 29 Mar 2007 13:27:31 GMT</pubDate></item><item><title><![CDATA[Reply to strdup ist deprecated on Fri, 30 Mar 2007 09:00:46 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/2813">@groovemaster</a><br />
Wenn es keine Dreistigkeit ist, dann ist es zumindest unglücklich (und das haben Leute von MS längst auch schon gesagt). Der VC Compiler warnt bei einigen Standardfunktionen (wie z.B. std::copy) sie wären deprecated, was aus Sicht des C++ Standards schlicht käse ist. Und da der C++ Standard das einzige Dokument ist, dass eine Standardfunktion als deprecated einstufen kann, wäre es sinnvoller gewesen, wenn MS eine andere Wortwahl verwendet hätte.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1255835</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1255835</guid><dc:creator><![CDATA[HumeSikkins]]></dc:creator><pubDate>Fri, 30 Mar 2007 09:00:46 GMT</pubDate></item></channel></rss>