<?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[größe eines vektors]]></title><description><![CDATA[<p>Ich habe folgenden code für einen Vektor:</p>
<pre><code>int anzahl=14;
vector&lt;int&gt; frequenzen(anzahl+1);
</code></pre>
<p>jetz möchte ich die größe dieses vectors bestimmen und bekomme mit</p>
<pre><code>sizeof frequenzen
</code></pre>
<p>das ergebnis 40</p>
<p>wo liegt da der fehler, mit welcher funktion kann ich die richtige größe bestimmen... mit is schon klar das int die größ 4 byte hat, deshalb versteh ich nicht wo da die 40 herkommt</p>
<p>danke</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/296002/größe-eines-vektors</link><generator>RSS for Node</generator><lastBuildDate>Sat, 15 Aug 2026 05:15:09 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/296002.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 26 Nov 2011 08:13:47 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to größe eines vektors on Sat, 26 Nov 2011 08:13:47 GMT]]></title><description><![CDATA[<p>Ich habe folgenden code für einen Vektor:</p>
<pre><code>int anzahl=14;
vector&lt;int&gt; frequenzen(anzahl+1);
</code></pre>
<p>jetz möchte ich die größe dieses vectors bestimmen und bekomme mit</p>
<pre><code>sizeof frequenzen
</code></pre>
<p>das ergebnis 40</p>
<p>wo liegt da der fehler, mit welcher funktion kann ich die richtige größe bestimmen... mit is schon klar das int die größ 4 byte hat, deshalb versteh ich nicht wo da die 40 herkommt</p>
<p>danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2148999</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2148999</guid><dc:creator><![CDATA[bikstfri]]></dc:creator><pubDate>Sat, 26 Nov 2011 08:13:47 GMT</pubDate></item><item><title><![CDATA[Reply to größe eines vektors on Sat, 26 Nov 2011 08:19:51 GMT]]></title><description><![CDATA[<p><a href="http://new.cplusplus.com/reference/stl/vector/" rel="nofollow">http://new.cplusplus.com/reference/stl/vector/</a></p>
<pre><code class="language-cpp">frequenzen.size();
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2149001</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2149001</guid><dc:creator><![CDATA[freaky]]></dc:creator><pubDate>Sat, 26 Nov 2011 08:19:51 GMT</pubDate></item><item><title><![CDATA[Reply to größe eines vektors on Sat, 26 Nov 2011 08:29:16 GMT]]></title><description><![CDATA[<p>Genau, sizeof(frequenzen) macht etwas völlig anderes (gibt nähmlich die Größe des vector-Objekts in Bytes zurück). Stattdessen gibt es in allen STL-Containern die Funktion size(), die std::size_t zurückgibt (eig. size_type, ist ein typedef). Damit kannst du die Anzahl der Elemente abfragen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2149004</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2149004</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sat, 26 Nov 2011 08:29:16 GMT</pubDate></item><item><title><![CDATA[Reply to größe eines vektors on Sat, 26 Nov 2011 08:31:09 GMT]]></title><description><![CDATA[<p>danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2149005</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2149005</guid><dc:creator><![CDATA[bikstfri]]></dc:creator><pubDate>Sat, 26 Nov 2011 08:31:09 GMT</pubDate></item></channel></rss>