<?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[Zeiger auf erstes std::vector element]]></title><description><![CDATA[<p>Liebe Community,</p>
<p>ich habe eine Funktion funk(double *x)</p>
<p>und einen vector&lt;double&gt; a .</p>
<p>Ich möchte jetzt gerne einen Zeiger auf das erste Element von a haben, das ich dan an funk übergeben kann.</p>
<p>Kann mir jemand sagen wie ich da vorgehen muss?<br />
Hab mit begin() und at() rumgespielt, das funktioniert leider nicht.</p>
<p>MfG BTK</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/333061/zeiger-auf-erstes-std-vector-element</link><generator>RSS for Node</generator><lastBuildDate>Mon, 27 Apr 2026 06:50:45 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/333061.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 09 Jun 2015 07:41:44 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Zeiger auf erstes std::vector element on Tue, 09 Jun 2015 07:41:44 GMT]]></title><description><![CDATA[<p>Liebe Community,</p>
<p>ich habe eine Funktion funk(double *x)</p>
<p>und einen vector&lt;double&gt; a .</p>
<p>Ich möchte jetzt gerne einen Zeiger auf das erste Element von a haben, das ich dan an funk übergeben kann.</p>
<p>Kann mir jemand sagen wie ich da vorgehen muss?<br />
Hab mit begin() und at() rumgespielt, das funktioniert leider nicht.</p>
<p>MfG BTK</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2456188</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2456188</guid><dc:creator><![CDATA[BTK]]></dc:creator><pubDate>Tue, 09 Jun 2015 07:41:44 GMT</pubDate></item><item><title><![CDATA[Reply to Zeiger auf erstes std::vector element on Tue, 09 Jun 2015 07:46:55 GMT]]></title><description><![CDATA[<pre><code>&amp;a[0]
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2456189</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2456189</guid><dc:creator><![CDATA[tkausl]]></dc:creator><pubDate>Tue, 09 Jun 2015 07:46:55 GMT</pubDate></item><item><title><![CDATA[Reply to Zeiger auf erstes std::vector element on Tue, 09 Jun 2015 08:07:20 GMT]]></title><description><![CDATA[<p>Oder seit C++11 auch: <code>a.data();</code></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2456190</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2456190</guid><dc:creator><![CDATA[sebi707]]></dc:creator><pubDate>Tue, 09 Jun 2015 08:07:20 GMT</pubDate></item><item><title><![CDATA[Reply to Zeiger auf erstes std::vector element on Tue, 09 Jun 2015 08:07:52 GMT]]></title><description><![CDATA[<pre><code>assert(!a.empty());
    funk(&amp;a.front());
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2456191</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2456191</guid><dc:creator><![CDATA[Kenner der Vektoren]]></dc:creator><pubDate>Tue, 09 Jun 2015 08:07:52 GMT</pubDate></item><item><title><![CDATA[Reply to Zeiger auf erstes std::vector element on Tue, 09 Jun 2015 08:11:06 GMT]]></title><description><![CDATA[<p>Nachtrag:<br />
<code>a.data();</code> ist auch für leere Container gültig. Anders als bei <code>&amp;a[0]</code> und <code>&amp;a.front();</code> muss man also nicht vorher prüfen ob der vector leer ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2456192</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2456192</guid><dc:creator><![CDATA[sebi707]]></dc:creator><pubDate>Tue, 09 Jun 2015 08:11:06 GMT</pubDate></item><item><title><![CDATA[Reply to Zeiger auf erstes std::vector element on Tue, 09 Jun 2015 11:26:00 GMT]]></title><description><![CDATA[<blockquote>
<p>Hab mit begin() und at() rumgespielt, das funktioniert leider nicht.</p>
</blockquote>
<p>funk(&amp;*a.begin());<br />
funk(&amp;a[0]);<br />
funk(&amp;a.front());<br />
funk(a.data());<br />
funk(&amp;a.data()[0]);</p>
<p>usw.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2456204</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2456204</guid><dc:creator><![CDATA[Gast3]]></dc:creator><pubDate>Tue, 09 Jun 2015 11:26:00 GMT</pubDate></item></channel></rss>