<?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[calloc]]></title><description><![CDATA[<p>Hallo Leute,</p>
<p>was stimmt hier nicht?</p>
<pre><code class="language-cpp">...

struct client *client;

...

client = calloc ( 1, sizeof ( *client ) );
</code></pre>
<p>ich bekomme hier immer diesen Fehler:<br />
error: invalid conversion from 'void*' to 'client*'</p>
<p>und wenn ich nun, es ist übrigens ein samplecode wo ich dachte der läuft von sich aus, ein (client*) vor calloc gebe, dann gibt es diesen Fehler</p>
<p>error: expected primary-expression before ')' token<br />
error: expected `;' before 'calloc'</p>
<p>für jede Hilfe wäre ich dankbar ... ist wahrscheinlich eh nur ein sehr dummer denkfehler von mir, aber ich hab gerade keine zeit dafür.</p>
<p>grüße<br />
noq</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/237811/calloc</link><generator>RSS for Node</generator><lastBuildDate>Wed, 23 Sep 2026 06:09:27 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/237811.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 02 Apr 2009 09:00:45 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to calloc on Thu, 02 Apr 2009 09:00:45 GMT]]></title><description><![CDATA[<p>Hallo Leute,</p>
<p>was stimmt hier nicht?</p>
<pre><code class="language-cpp">...

struct client *client;

...

client = calloc ( 1, sizeof ( *client ) );
</code></pre>
<p>ich bekomme hier immer diesen Fehler:<br />
error: invalid conversion from 'void*' to 'client*'</p>
<p>und wenn ich nun, es ist übrigens ein samplecode wo ich dachte der läuft von sich aus, ein (client*) vor calloc gebe, dann gibt es diesen Fehler</p>
<p>error: expected primary-expression before ')' token<br />
error: expected `;' before 'calloc'</p>
<p>für jede Hilfe wäre ich dankbar ... ist wahrscheinlich eh nur ein sehr dummer denkfehler von mir, aber ich hab gerade keine zeit dafür.</p>
<p>grüße<br />
noq</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1689698</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1689698</guid><dc:creator><![CDATA[noq(off)]]></dc:creator><pubDate>Thu, 02 Apr 2009 09:00:45 GMT</pubDate></item><item><title><![CDATA[Reply to calloc on Thu, 02 Apr 2009 09:06:34 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">struct client *c;

...

c = calloc ( 1, sizeof ( client ) );
</code></pre>
<p>Ev. brauchts noch einen cast nach client*.</p>
<p>Simon</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1689702</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1689702</guid><dc:creator><![CDATA[theta]]></dc:creator><pubDate>Thu, 02 Apr 2009 09:06:34 GMT</pubDate></item><item><title><![CDATA[Reply to calloc on Thu, 02 Apr 2009 09:10:31 GMT]]></title><description><![CDATA[<p>Du würdest ja auch nie auf die Idee kommen, sowas hier zu schreiben, oder?</p>
<pre><code class="language-cpp">char char=0;
</code></pre>
<p><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/1689705</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1689705</guid><dc:creator><![CDATA[_matze]]></dc:creator><pubDate>Thu, 02 Apr 2009 09:10:31 GMT</pubDate></item><item><title><![CDATA[Reply to calloc on Thu, 02 Apr 2009 09:11:37 GMT]]></title><description><![CDATA[<p>nein, es ist irgendwie immer noch das selbe :-\</p>
<p>aber danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1689706</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1689706</guid><dc:creator><![CDATA[noq(off)]]></dc:creator><pubDate>Thu, 02 Apr 2009 09:11:37 GMT</pubDate></item><item><title><![CDATA[Reply to calloc on Thu, 02 Apr 2009 09:14:00 GMT]]></title><description><![CDATA[<p>noq(off) schrieb:</p>
<blockquote>
<p>nein, es ist irgendwie immer noch das selbe :-\</p>
<p>aber danke</p>
</blockquote>
<p>Kann nicht sein! Nimm das Beispiel von theta (also &quot;struct client *c&quot;, nicht &quot;struct client *client&quot;!), caste die Rückgabe von calloc noch (da C++), und dann sollten deine beiden Fehlermeldungen verschwunden sein.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1689707</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1689707</guid><dc:creator><![CDATA[_matze]]></dc:creator><pubDate>Thu, 02 Apr 2009 09:14:00 GMT</pubDate></item><item><title><![CDATA[Reply to calloc on Thu, 02 Apr 2009 09:17:02 GMT]]></title><description><![CDATA[<p>_matze schrieb:</p>
<blockquote>
<p>Du würdest ja auch nie auf die Idee kommen, sowas hier zu schreiben, oder?</p>
<pre><code class="language-cpp">char char=0;
</code></pre>
<p><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>
</blockquote>
<p>ups, ja ... danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1689710</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1689710</guid><dc:creator><![CDATA[noq (off)]]></dc:creator><pubDate>Thu, 02 Apr 2009 09:17:02 GMT</pubDate></item><item><title><![CDATA[Reply to calloc on Thu, 02 Apr 2009 17:46:07 GMT]]></title><description><![CDATA[<p>Falls du C++ programmieren solltest, würde ich eher zu <code>new</code> bzw. <code>new[]</code> als den C-Speicherverwaltungsfunktionen raten. Besonders, wenn du nicht nur mit PODs arbeitest, kannst du schnell Probleme kriegen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1690028</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1690028</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Thu, 02 Apr 2009 17:46:07 GMT</pubDate></item></channel></rss>