<?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[Weider n header Problem]]></title><description><![CDATA[<p>Warum geht das den nicht?<br />
Fehler:<br />
-------------- Build: Debug in Bot ---------------<br />
Compiling: topics of conversation of Bot.cpp<br />
topics of conversation of Bot.cpp:7: error: expected constructor, destructor, or type conversion before '.' token<br />
topics of conversation of Bot.cpp:7: error: expected <code>,' or</code>;' before '.' token<br />
Process terminated with status 1 (0 minutes, 0 seconds)<br />
2 errors, 0 warnings</p>
<pre><code class="language-cpp">//topics of conversation of Bot.h
#ifndef TOPICS_OF_CONVERSATION_OF_BOT_H_INCLUDED
#define TOPICS_OF_CONVERSATION_OF_BOT_H_INCLUDED

#include &lt;string&gt;
#include &lt;vector&gt;

extern std::vector&lt;std::string&gt; gruss;

#endif
</code></pre>
<pre><code class="language-cpp">//topics of conversation of Bot.cpp
#include &quot;topics of conversation of Bot.h&quot;
#include &lt;string&gt;
#include &lt;vector&gt;
using namespace std;

vector&lt;string&gt; gruss;
gruss.push_back(&quot;Hello&quot;);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/169030/weider-n-header-problem</link><generator>RSS for Node</generator><lastBuildDate>Wed, 16 Sep 2026 15:05:29 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/169030.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 31 Dec 2006 16:10:38 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Weider n header Problem on Sun, 31 Dec 2006 16:10:38 GMT]]></title><description><![CDATA[<p>Warum geht das den nicht?<br />
Fehler:<br />
-------------- Build: Debug in Bot ---------------<br />
Compiling: topics of conversation of Bot.cpp<br />
topics of conversation of Bot.cpp:7: error: expected constructor, destructor, or type conversion before '.' token<br />
topics of conversation of Bot.cpp:7: error: expected <code>,' or</code>;' before '.' token<br />
Process terminated with status 1 (0 minutes, 0 seconds)<br />
2 errors, 0 warnings</p>
<pre><code class="language-cpp">//topics of conversation of Bot.h
#ifndef TOPICS_OF_CONVERSATION_OF_BOT_H_INCLUDED
#define TOPICS_OF_CONVERSATION_OF_BOT_H_INCLUDED

#include &lt;string&gt;
#include &lt;vector&gt;

extern std::vector&lt;std::string&gt; gruss;

#endif
</code></pre>
<pre><code class="language-cpp">//topics of conversation of Bot.cpp
#include &quot;topics of conversation of Bot.h&quot;
#include &lt;string&gt;
#include &lt;vector&gt;
using namespace std;

vector&lt;string&gt; gruss;
gruss.push_back(&quot;Hello&quot;);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1200398</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1200398</guid><dc:creator><![CDATA[Stromberg]]></dc:creator><pubDate>Sun, 31 Dec 2006 16:10:38 GMT</pubDate></item><item><title><![CDATA[Reply to Weider n header Problem on Sun, 31 Dec 2006 16:22:06 GMT]]></title><description><![CDATA[<p>Und wo ist deine FUnktion? Du kannst doch nicht einfach die push_back-Anweisung lose irgendwo reinschreiben. Das gehört immer in eine Funktion oder Methode.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1200405</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1200405</guid><dc:creator><![CDATA[Artchi]]></dc:creator><pubDate>Sun, 31 Dec 2006 16:22:06 GMT</pubDate></item><item><title><![CDATA[Reply to Weider n header Problem on Sun, 31 Dec 2006 16:25:09 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Zumindest die main-Funktion sollte schon da sein.</p>
<p>chrische</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1200409</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1200409</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sun, 31 Dec 2006 16:25:09 GMT</pubDate></item><item><title><![CDATA[Reply to Weider n header Problem on Sun, 31 Dec 2006 16:35:55 GMT]]></title><description><![CDATA[<p>Warum machst du eigentlich globale Variablen? Meistens kommt man ohne solche aus. Aber falls du es unbedingt machen willst, willst du anscheinend einfach deine Variable gruss initialisieren? Dann wäre sowas sinnvoll:</p>
<pre><code class="language-cpp">// xyz.cpp
#include &quot;Bot.h&quot;

void init_gruss()
{
    gruss.push_back(&quot;Hallo&quot;);
}

int main()
{
    init_gruss();
    // restlicher programmverlauf...
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1200411</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1200411</guid><dc:creator><![CDATA[Artchi]]></dc:creator><pubDate>Sun, 31 Dec 2006 16:35:55 GMT</pubDate></item><item><title><![CDATA[Reply to Weider n header Problem on Sun, 31 Dec 2006 16:43:16 GMT]]></title><description><![CDATA[<p>Ja mh eine main hab ich natürlich schon ich hab halt jetzt nur das rauskopiert. Ich wollte halt einfacch in einer headre und cpp meine vetor string initialisieren..... oder kann ich meine vector strings auch nur in einer header deklarieren und dann initialisieren?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1200414</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1200414</guid><dc:creator><![CDATA[Stromberg]]></dc:creator><pubDate>Sun, 31 Dec 2006 16:43:16 GMT</pubDate></item><item><title><![CDATA[Reply to Weider n header Problem on Sun, 31 Dec 2006 17:20:00 GMT]]></title><description><![CDATA[<p>Ja, ja das Weidern header Problem, wer kennt das nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1200425</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1200425</guid><dc:creator><![CDATA[[ schmaler ] [ breiter ]]]></dc:creator><pubDate>Sun, 31 Dec 2006 17:20:00 GMT</pubDate></item><item><title><![CDATA[Reply to Weider n header Problem on Sun, 31 Dec 2006 17:26:05 GMT]]></title><description><![CDATA[<p>Es hat nichts mit Vector zu tun. Du solltest dir bewusst werden, das Vector, int, short und deine eigenen Klassen, einfach TYPEN sind. Wenn du eine cpp-Datei hast, ist es ein Modul, eine Compile-Einheit. Headerdateien die du inkludierst, werden 1:1 eingefügt. Ein &quot;#include&quot; bewirkt, das die Datei 1:1 reinkopiert wird. Du könntest genauso gut im Texteditor den gesamten Textinhalt von einer Header-Datei markieren, kopieren (Strg+C) und anstelle des &quot;#include&quot; einfügen (Strg+V).</p>
<p>Du willst aber eine initialisierung einer einmalig vorhandenen Variable (in deinem Fall &quot;gruss&quot;) nur einmal haben. Wenn du sie in einem Header hättest, würde sie in jeder Compile-Einheit auftauchen. Nicht gerade gewollt, oder?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1200427</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1200427</guid><dc:creator><![CDATA[Artchi]]></dc:creator><pubDate>Sun, 31 Dec 2006 17:26:05 GMT</pubDate></item></channel></rss>