<?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[Inhalt von Testende]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich will daß ein Programm bei der Zahl 23 2 x 3 multipliziert u.s.w.<br />
Dabei versuche ich die Zahl zu zerlegen mit length</p>
<p>string str (Testende);<br />
cout &lt;&lt; &quot;The length of str is &quot; &lt;&lt; str.length() &lt;&lt; &quot; characters.\n&quot;;</p>
<p>Er gibt mir immer folgende MELDUNG:</p>
<p>main.cpp:23: error: initializing argument 1 of 'std::basic_string&lt;_CharT, _Traits, _Alloc&gt;::basic_string(const _CharT*, const _Alloc&amp;) [with _CharT = char, _Traits = std::char_traits&lt;char&gt;, _Alloc = std::allocator&lt;char&gt;]'<br />
main.cpp:23: error: invalid conversion from 'int' to 'const char*'</p>
<p>IRGENDWIE MUß ICH DIE VARIABLEN VERÄNDERN.</p>
<p>DANKE FÜR DEN TIPP</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/250906/inhalt-von-testende</link><generator>RSS for Node</generator><lastBuildDate>Tue, 15 Sep 2026 19:42:38 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/250906.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 26 Sep 2009 07:31:30 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Inhalt von Testende on Sat, 26 Sep 2009 07:31:30 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich will daß ein Programm bei der Zahl 23 2 x 3 multipliziert u.s.w.<br />
Dabei versuche ich die Zahl zu zerlegen mit length</p>
<p>string str (Testende);<br />
cout &lt;&lt; &quot;The length of str is &quot; &lt;&lt; str.length() &lt;&lt; &quot; characters.\n&quot;;</p>
<p>Er gibt mir immer folgende MELDUNG:</p>
<p>main.cpp:23: error: initializing argument 1 of 'std::basic_string&lt;_CharT, _Traits, _Alloc&gt;::basic_string(const _CharT*, const _Alloc&amp;) [with _CharT = char, _Traits = std::char_traits&lt;char&gt;, _Alloc = std::allocator&lt;char&gt;]'<br />
main.cpp:23: error: invalid conversion from 'int' to 'const char*'</p>
<p>IRGENDWIE MUß ICH DIE VARIABLEN VERÄNDERN.</p>
<p>DANKE FÜR DEN TIPP</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1784458</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1784458</guid><dc:creator><![CDATA[Bekell]]></dc:creator><pubDate>Sat, 26 Sep 2009 07:31:30 GMT</pubDate></item><item><title><![CDATA[Reply to Inhalt von Testende on Sat, 26 Sep 2009 07:34:54 GMT]]></title><description><![CDATA[<p>aber nicht den ganzen geheimen code zeigen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1784460</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1784460</guid><dc:creator><![CDATA[gfds]]></dc:creator><pubDate>Sat, 26 Sep 2009 07:34:54 GMT</pubDate></item><item><title><![CDATA[Reply to Inhalt von Testende on Sat, 26 Sep 2009 07:41:01 GMT]]></title><description><![CDATA[<pre><code>#include &lt;iostream&gt;
#include &lt;string&gt;
using namespace std;

int quot;
int Testbeginn = 1;
int Testende = 100;
int Zehler=0;
int TS;

int main ()
{
 cout&lt;&lt; &quot;Testbeginn &quot;;
cin&gt;&gt;Testbeginn;
cout&lt;&lt;&quot;Testende&quot;;
cin&gt;&gt;Testende;

/*ZahlAuseinanernehmer*/
 string str (Testende);
  cout &lt;&lt; &quot;The length of str is &quot; &lt;&lt; str.length() &lt;&lt; &quot; characters.\n&quot;;

for(int i=1;i&lt;=Testende/+1;i=i+1)
	{
	quot=Testende/i;
		if(0==Testende%i)
		{
		Zehler=Zehler+1;
		cout&lt;&lt;quot&lt;&lt;&quot; &quot;;
		TS=TS+quot;
		}		
	}		
cout&lt;&lt;&quot; als Teiler der Zahl. &quot;&lt;&lt;Testende&lt;&lt;&quot; hat also &quot;&lt;&lt;Zehler&lt;&lt;&quot; Teiler. Die Summe dieser Teiler ist: &quot;&lt;&lt;TS&lt;&lt; &quot; =TS&quot;;
}
</code></pre>
<p>HIER IST ER, ER IST ABER LÄNGST NICHT FERTIG, WEIL ICH IN DAS GERÜST EINES ANDERENPROGRAMMES, WELCHE SEINE FUNKTION ERFÜLLTE, EINBAUE</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1784461</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1784461</guid><dc:creator><![CDATA[Bekell]]></dc:creator><pubDate>Sat, 26 Sep 2009 07:41:01 GMT</pubDate></item><item><title><![CDATA[Reply to Inhalt von Testende on Sat, 26 Sep 2009 07:48:51 GMT]]></title><description><![CDATA[<p>du kannst in C++ nicht direkt int in string umwandeln , da musst du den umweg über stringstream gehen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1784462</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1784462</guid><dc:creator><![CDATA[gfds]]></dc:creator><pubDate>Sat, 26 Sep 2009 07:48:51 GMT</pubDate></item><item><title><![CDATA[Reply to Inhalt von Testende on Sat, 26 Sep 2009 07:52:35 GMT]]></title><description><![CDATA[<p>Möglichkeit 1:</p>
<pre><code class="language-cpp">#include &lt;sstream&gt;
#include &lt;string&gt;

// ...

    std::stringstream temp;
    temp &lt;&lt; Testende; // ich schließe mal aus der Fehlermeldung, dass Testende ein int ist
    std::string my_str(temp.str());
</code></pre>
<p>dann haste deine Zahl 23 in my_str als &quot;23&quot; und kannst damit weiterarbeiten.</p>
<p>warum &quot;Möglichkeit 1&quot; ?<br />
ganz einfach, du könntest auch sprintf aus &lt;cstdio&gt; verwenden<br />
oder boost::lexical_cast<a href="std::string" rel="nofollow">std::string</a> aus der Boost-Bibliothek.</p>
<p>allerdings kannste die Zahl auch einfacher auseinander nehmen...<br />
also nicht erst in einen String umwandeln...</p>
<pre><code class="language-cpp">int count_digits(int number, int base) // zählt die Ziffern einer Zahl im System mit der Basis base (10 = dezimal, 2 = dual usw.)
{
    int digits = 0;
    if (number == 0)
        return 1;
    while (number &gt; 0)
    {
        ++digits;
        number /= base;
    }
    return digits;
}

// ...

    int digits = count_digits(Testende, 10);
    int* pDigits = new int[digits];
    int temp = Testende, cur = 1;
    if (temp == 0)
        pDigits[0] = 0;
    while (temp &gt; 0)
    {
        pDigits[digits - cur] = temp % 10;
        ++cur;
        temp /= 10;
    }

// ...
</code></pre>
<p>jetzt hast du in pDigits { 2, 3 } und kannst schön damit arbeiten^^</p>
<p>MfG DrakoXP</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1784464</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1784464</guid><dc:creator><![CDATA[DrakoXP]]></dc:creator><pubDate>Sat, 26 Sep 2009 07:52:35 GMT</pubDate></item><item><title><![CDATA[Reply to Inhalt von Testende on Sat, 26 Sep 2009 08:21:11 GMT]]></title><description><![CDATA[<p>Erst mal dankeschön, muß das erst verarbeiten...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1784468</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1784468</guid><dc:creator><![CDATA[Bekell]]></dc:creator><pubDate>Sat, 26 Sep 2009 08:21:11 GMT</pubDate></item><item><title><![CDATA[Reply to Inhalt von Testende on Sat, 26 Sep 2009 09:09:34 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">std::cout &lt;&lt; (int)log10((double)Testende)+1;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1784478</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1784478</guid><dc:creator><![CDATA[oderHochwissenschaftlich]]></dc:creator><pubDate>Sat, 26 Sep 2009 09:09:34 GMT</pubDate></item><item><title><![CDATA[Reply to Inhalt von Testende on Sat, 26 Sep 2009 09:40:50 GMT]]></title><description><![CDATA[<p>Bekell schrieb:</p>
<blockquote>
<p>Erst mal dankeschön, muß das erst verarbeiten...</p>
</blockquote>
<p>Nochwas zum Verarbeiten: bei capslock legt die Service-Hotline auf.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1784485</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1784485</guid><dc:creator><![CDATA[otze]]></dc:creator><pubDate>Sat, 26 Sep 2009 09:40:50 GMT</pubDate></item></channel></rss>