<?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[Frage zu Casting]]></title><description><![CDATA[<p>Casting ist ja eine Typ-Umwandlung also z.B. &quot;int&quot; nach &quot;double&quot;. Ich mach das immer mit &quot;(double)MeinInteger&quot;.</p>
<p>Ich hab aber schon oft Castings mit &lt;double&gt; oder so ähnlich gesehen. Sind die identisch oder gibts da Unterschiede? Wenn ja welche?</p>
<p>Danke im Voraus.<br />
SWW13</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/243260/frage-zu-casting</link><generator>RSS for Node</generator><lastBuildDate>Sun, 20 Sep 2026 03:41:37 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/243260.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 14 Jun 2009 18:59:59 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Frage zu Casting on Sun, 14 Jun 2009 18:59:59 GMT]]></title><description><![CDATA[<p>Casting ist ja eine Typ-Umwandlung also z.B. &quot;int&quot; nach &quot;double&quot;. Ich mach das immer mit &quot;(double)MeinInteger&quot;.</p>
<p>Ich hab aber schon oft Castings mit &lt;double&gt; oder so ähnlich gesehen. Sind die identisch oder gibts da Unterschiede? Wenn ja welche?</p>
<p>Danke im Voraus.<br />
SWW13</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1726572</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1726572</guid><dc:creator><![CDATA[SWW13]]></dc:creator><pubDate>Sun, 14 Jun 2009 18:59:59 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu Casting on Sun, 14 Jun 2009 19:17:31 GMT]]></title><description><![CDATA[<p>Also ich verwende prinzipiell static_cast, was mit C++ eingeführt wurde und in Sachen Pointer besser ist, als die C Variante.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1726581</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1726581</guid><dc:creator><![CDATA[Cloppy]]></dc:creator><pubDate>Sun, 14 Jun 2009 19:17:31 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu Casting on Sun, 14 Jun 2009 19:23:30 GMT]]></title><description><![CDATA[<p>Ist dann &lt;double&gt; ein static cast? Und was macht das für nen Unterschied?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1726582</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1726582</guid><dc:creator><![CDATA[SWW13]]></dc:creator><pubDate>Sun, 14 Jun 2009 19:23:30 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu Casting on Sun, 14 Jun 2009 19:31:29 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">double d=static_cast&lt;double&gt;(i);
douole d=(double)i;
double d=double(i);//ich nehme bisher diese variante am liebsten
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1726587</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1726587</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Sun, 14 Jun 2009 19:31:29 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu Casting on Sun, 14 Jun 2009 19:36:38 GMT]]></title><description><![CDATA[<p>Ok, es macht also keine Unterschied welche man nimmt, oder?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1726592</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1726592</guid><dc:creator><![CDATA[SWW13]]></dc:creator><pubDate>Sun, 14 Jun 2009 19:36:38 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu Casting on Sun, 14 Jun 2009 19:45:45 GMT]]></title><description><![CDATA[<p>SWW13 schrieb:</p>
<blockquote>
<p>Ok, es macht also keine Unterschied welche man nimmt, oder?</p>
</blockquote>
<p>DOCH!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1726597</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1726597</guid><dc:creator><![CDATA[jackie chan PLUS PLUS!]]></dc:creator><pubDate>Sun, 14 Jun 2009 19:45:45 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu Casting on Sun, 14 Jun 2009 19:49:03 GMT]]></title><description><![CDATA[<p>SWW13 schrieb:</p>
<blockquote>
<p>Ok, es macht also keine Unterschied welche man nimmt, oder?</p>
</blockquote>
<p>bei double und int nicht.<br />
bei zeigern ist es heikler, da nehme ich auch static_cast oder const_cast oder dynamsic_cast oder reinterpret_cast, was halt das geringste übel ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1726600</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1726600</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Sun, 14 Jun 2009 19:49:03 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu Casting on Sun, 14 Jun 2009 19:55:21 GMT]]></title><description><![CDATA[<p>Hmm, ok.</p>
<p>Bei normalen strd. Typen ohne Zeiger kann ich also alle nehmen.(?)<br />
Bei Zeiger sollte ich dann einen von den ..._cast&lt;... *&gt; nehmen, oder? Was ist der Unterschied zwischen denen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1726605</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1726605</guid><dc:creator><![CDATA[SWW13]]></dc:creator><pubDate>Sun, 14 Jun 2009 19:55:21 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu Casting on Sun, 14 Jun 2009 20:01:46 GMT]]></title><description><![CDATA[<p>ein wenig text zu den &lt;&gt;-casts:<br />
<a href="http://www.geocities.com/matfauzee1/Module22.html" rel="nofollow">http://www.geocities.com/matfauzee1/Module22.html</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1726608</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1726608</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Sun, 14 Jun 2009 20:01:46 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu Casting on Sun, 14 Jun 2009 20:03:39 GMT]]></title><description><![CDATA[<p>Dann hab ich für die nächsten Tage was zu lesen...</p>
<p>Danke für die Infos.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1726610</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1726610</guid><dc:creator><![CDATA[SWW13]]></dc:creator><pubDate>Sun, 14 Jun 2009 20:03:39 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu Casting on Mon, 15 Jun 2009 00:12:32 GMT]]></title><description><![CDATA[<p><a href="http://tutorial.schornboeck.net/casts.htm" rel="nofollow">http://tutorial.schornboeck.net/casts.htm</a></p>
<blockquote>
<p>Diese beiden Casts funktionieren zwar auch, allerdings casten sie immer - auch wenn eine Konvertierung garnicht sinnvoll ist. Deswegen sollte man in C++ besser die 'neuen' casts wie static_cast verwenden.</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/1726688</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1726688</guid><dc:creator><![CDATA[freaky]]></dc:creator><pubDate>Mon, 15 Jun 2009 00:12:32 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu Casting on Mon, 15 Jun 2009 01:26:17 GMT]]></title><description><![CDATA[<p>das klingt mir ein wenig zu absolut.</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;string&gt;
using namespace std;

char const* const rootpath=&quot;c:/foo&quot;;

int main()
{
	string fullpath=static_cast&lt;string&gt;(rootpath)+&quot;/log.txt&quot;;
	cout&lt;&lt;fullpath&lt;&lt;'\n';
}
</code></pre>
<p>das finde ich nicht hübsch.<br />
deswegen nehme ich bei werten, egal ob string oder double) den funktionalstil.</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;string&gt;
using namespace std;

char const* const rootpath=&quot;c:/foo&quot;;

int main()
{
	string fullpath=string(rootpath)+&quot;/log.txt&quot;;
	cout&lt;&lt;fullpath&lt;&lt;'\n';
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1726694</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1726694</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Mon, 15 Jun 2009 01:26:17 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu Casting on Mon, 15 Jun 2009 10:21:18 GMT]]></title><description><![CDATA[<p>Naja gut wie du meinst volkard. Ich denke es ist auch eine Frage des Geschmacks und ich werde bei static_cast bleiben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1726846</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1726846</guid><dc:creator><![CDATA[freaky]]></dc:creator><pubDate>Mon, 15 Jun 2009 10:21:18 GMT</pubDate></item></channel></rss>