<?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 boost::tokenizer]]></title><description><![CDATA[<p>Hi,</p>
<pre><code class="language-cpp">typedef boost::tokenizer&lt; boost::char_separator&lt;char&gt; &gt; Tokenizer;
//...
void Tokenize(Tokenizer* tok) {
    if (tok &amp;&amp; CallBack) {
        for (Tokenizer::iterator tok_iter = tok-&gt;begin(); tok_iter != tok-&gt;end(); ++tok_iter) {
            CallBack(*tok_iter); //&lt;- Fehler
        }
    }
}
</code></pre>
<p>CallBack benötigt ein *char als Argument, ich habe keine Möglichkeit dies zu ändern.<br />
Wie bekomm ich aus dem *tok_iter einen std::string oder gleich ein *char?</p>
<p>Danke im voraus...</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/216829/frage-zu-boost-tokenizer</link><generator>RSS for Node</generator><lastBuildDate>Sun, 11 Oct 2026 01:28:05 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/216829.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 29 Jun 2008 12:23:54 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Frage zu boost::tokenizer on Sun, 29 Jun 2008 12:29:47 GMT]]></title><description><![CDATA[<p>Hi,</p>
<pre><code class="language-cpp">typedef boost::tokenizer&lt; boost::char_separator&lt;char&gt; &gt; Tokenizer;
//...
void Tokenize(Tokenizer* tok) {
    if (tok &amp;&amp; CallBack) {
        for (Tokenizer::iterator tok_iter = tok-&gt;begin(); tok_iter != tok-&gt;end(); ++tok_iter) {
            CallBack(*tok_iter); //&lt;- Fehler
        }
    }
}
</code></pre>
<p>CallBack benötigt ein *char als Argument, ich habe keine Möglichkeit dies zu ändern.<br />
Wie bekomm ich aus dem *tok_iter einen std::string oder gleich ein *char?</p>
<p>Danke im voraus...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1537859</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1537859</guid><dc:creator><![CDATA[milan1612]]></dc:creator><pubDate>Sun, 29 Jun 2008 12:29:47 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu boost::tokenizer on Sun, 29 Jun 2008 12:35:41 GMT]]></title><description><![CDATA[<p>Also wenn das die richtige Vorgehensweise ist,wie du das da machst, dann nimm doch einfach einen Cast. (static_cast&lt;char*&gt;(*tok_iter) )</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1537868</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1537868</guid><dc:creator><![CDATA[drakon]]></dc:creator><pubDate>Sun, 29 Jun 2008 12:35:41 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu boost::tokenizer on Sun, 29 Jun 2008 12:57:42 GMT]]></title><description><![CDATA[<p>Dann bekomme ich das hier:</p>
<blockquote>
<p>error: invalid static_cast from type <code>const std::basic\_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;' to type</code>char*'</p>
</blockquote>
<p>EDIT: Habs geschafft mit:</p>
<pre><code class="language-cpp">&amp;(*tok_iter-&gt;c_str())
</code></pre>
<p>und der Änderung in const char*.</p>
<p>Trotzdem Danke <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1537875</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1537875</guid><dc:creator><![CDATA[milan1612]]></dc:creator><pubDate>Sun, 29 Jun 2008 12:57:42 GMT</pubDate></item></channel></rss>