<?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[&#x5C;t durch &amp;quot;.&amp;quot; ersetzen??]]></title><description><![CDATA[<p>Hallo,<br />
habe da ein kleines optisches Problem (konsolenanwendung):<br />
verkürzter Code:</p>
<pre><code class="language-cpp">for (int i=0; i&lt;15;i++)
     cout &lt;&lt; &quot;\n\t&quot; &lt;&lt; i &lt;&lt; &quot;) &quot; &lt;&lt; &quot;\t\t&quot; &lt;&lt; GetText(i);
</code></pre>
<p>Nun ist das (wie im Code ersichtlich) eine Liste mit 14 Punkten und man kann leider nicht mehr ganz so leicht erkennen, welcher Text (rechts) zu welcher Zahl (links) gehört.<br />
Eine Lösungsidee wäre die leeren Stellen die durch &quot;\t&quot; erzeugt werden mit &quot;.&quot; zu füllen. Jedoch bin ich da mit meinem Latein gewaltig am Ende. Könnt ihr mir da weiterhelfen?? Wär echt super! Danke</p>
<p>PS: Bin auch für andere Lösungsvorschläge bereits, sofern sie in mein Programm passen, dass ich aus Platzgründen hier nicht gepostet habe...</p>
<p>PPS: Der Code ist nur zur Veranschaulichung der Situation. Es ist nicht grundsätzlich gegeben, dass der linke Text (im Code &quot;i&quot;) immer nur eine 1- bzw. 2-stellige Zahl ist...</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/220428/t-durch-quot-quot-ersetzen</link><generator>RSS for Node</generator><lastBuildDate>Wed, 07 Oct 2026 03:55:35 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/220428.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 16 Aug 2008 01:12:38 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to &#x5C;t durch &amp;quot;.&amp;quot; ersetzen?? on Sat, 16 Aug 2008 01:14:20 GMT]]></title><description><![CDATA[<p>Hallo,<br />
habe da ein kleines optisches Problem (konsolenanwendung):<br />
verkürzter Code:</p>
<pre><code class="language-cpp">for (int i=0; i&lt;15;i++)
     cout &lt;&lt; &quot;\n\t&quot; &lt;&lt; i &lt;&lt; &quot;) &quot; &lt;&lt; &quot;\t\t&quot; &lt;&lt; GetText(i);
</code></pre>
<p>Nun ist das (wie im Code ersichtlich) eine Liste mit 14 Punkten und man kann leider nicht mehr ganz so leicht erkennen, welcher Text (rechts) zu welcher Zahl (links) gehört.<br />
Eine Lösungsidee wäre die leeren Stellen die durch &quot;\t&quot; erzeugt werden mit &quot;.&quot; zu füllen. Jedoch bin ich da mit meinem Latein gewaltig am Ende. Könnt ihr mir da weiterhelfen?? Wär echt super! Danke</p>
<p>PS: Bin auch für andere Lösungsvorschläge bereits, sofern sie in mein Programm passen, dass ich aus Platzgründen hier nicht gepostet habe...</p>
<p>PPS: Der Code ist nur zur Veranschaulichung der Situation. Es ist nicht grundsätzlich gegeben, dass der linke Text (im Code &quot;i&quot;) immer nur eine 1- bzw. 2-stellige Zahl ist...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1565804</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1565804</guid><dc:creator><![CDATA[3Stein]]></dc:creator><pubDate>Sat, 16 Aug 2008 01:14:20 GMT</pubDate></item><item><title><![CDATA[Reply to &#x5C;t durch &amp;quot;.&amp;quot; ersetzen?? on Sat, 16 Aug 2008 04:32:46 GMT]]></title><description><![CDATA[<p>3Stein schrieb:</p>
<blockquote>
<p>Nun ist das (wie im Code ersichtlich) eine Liste mit 14 Punkten</p>
</blockquote>
<p>nein 15</p>
<pre><code class="language-cpp">for (int i=0; i&lt;15;i++)
     cout &lt;&lt; &quot;\n\t&quot; &lt;&lt; i &lt;&lt; &quot;) &quot; &lt;&lt; &quot;.&quot; &lt;&lt; GetText(i);
</code></pre>
<p>so <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1565813</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1565813</guid><dc:creator><![CDATA[kindergarten]]></dc:creator><pubDate>Sat, 16 Aug 2008 04:32:46 GMT</pubDate></item><item><title><![CDATA[Reply to &#x5C;t durch &amp;quot;.&amp;quot; ersetzen?? on Sat, 16 Aug 2008 09:57:50 GMT]]></title><description><![CDATA[<p>Ein paar Ansätze...</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;iomanip&gt;
#include &lt;sstream&gt;
#include &lt;string&gt;

using namespace std;

string GetText(int i)
{
	stringstream buf;
	buf &lt;&lt; &quot;Der &quot; &lt;&lt; i &lt;&lt; &quot;. Text&quot;;
	return buf.str();
}

int main(int argc, char *argv[])
{
	for (int i = 0; i &lt; 1100; i += 90) {
		stringstream buf;
		buf &lt;&lt; i &lt;&lt; &quot;) &quot;;
		string str = buf.str();
		str.resize(20, '.');
		cout &lt;&lt; &quot;  &quot; &lt;&lt; str &lt;&lt; &quot; &quot; &lt;&lt; GetText(i) &lt;&lt; endl;
	}

	for (int i = 0; i &lt; 1100; i += 90) {
		stringstream buf;
		buf &lt;&lt; i &lt;&lt; &quot;) &quot;;
		cout &lt;&lt; &quot;  &quot; &lt;&lt; setw(4) &lt;&lt; i &lt;&lt; &quot;) .............. &quot; &lt;&lt; GetText(i) &lt;&lt; endl;
	}

	for (int i = 0; i &lt; 1100; i += 90) {
		stringstream buf;
		buf &lt;&lt; i &lt;&lt; &quot;) &quot;;
		cout &lt;&lt; &quot;  &quot; &lt;&lt; left &lt;&lt; setw(20) &lt;&lt; setfill('.') &lt;&lt; buf.str() &lt;&lt; &quot; &quot; &lt;&lt; GetText(i) &lt;&lt; endl;
	}
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1565871</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1565871</guid><dc:creator><![CDATA[lagalopex]]></dc:creator><pubDate>Sat, 16 Aug 2008 09:57:50 GMT</pubDate></item><item><title><![CDATA[Reply to &#x5C;t durch &amp;quot;.&amp;quot; ersetzen?? on Sat, 16 Aug 2008 12:54:44 GMT]]></title><description><![CDATA[<p>@kindergarten:<br />
ja 15. Im O-Code sind es 14. Daher der Fehler <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61b.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_tongue"
      title=":-P"
      alt="😛"
    /><br />
aber ich brauchte mehr Punkte als einen, denn er Abstand soll ja nach wie vor \t-groß sein</p>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/17281">@lagalopex</a>: GENIAL! DANKE!!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1565941</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1565941</guid><dc:creator><![CDATA[3Stein]]></dc:creator><pubDate>Sat, 16 Aug 2008 12:54:44 GMT</pubDate></item><item><title><![CDATA[Reply to &#x5C;t durch &amp;quot;.&amp;quot; ersetzen?? on Sat, 16 Aug 2008 14:48:24 GMT]]></title><description><![CDATA[<p>Ich hab grad mal ein wenig herumgespielt, folgendes ist dabei rumgekommen, nur für den Fall, dass es jemanden interessieren könnte:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;windows.h&gt;

unsigned int getConsoleXPos()
{
	CONSOLE_SCREEN_BUFFER_INFO info;
	GetConsoleScreenBufferInfo( GetStdHandle(STD_OUTPUT_HANDLE), &amp;info );
	return info.dwCursorPosition.X;
}

template&lt;char repl_char&gt;
std::ostream&amp; tab_repl( std::ostream&amp; o )
{
	static const unsigned int tab_size = 8;
	const unsigned int count = tab_size - ( getConsoleXPos() % tab_size );
	for ( unsigned int i=0; i&lt;count; i++ )
		o &lt;&lt; repl_char;
	return o;
}

int main()
{
	std::cout &lt;&lt; &quot;\t&quot; &lt;&lt; 5 &lt;&lt; &quot;\t\t&quot; &lt;&lt; &quot;Hallo&quot; &lt;&lt; std::endl;
	std::cout &lt;&lt; tab_repl&lt;'.'&gt; &lt;&lt; 5 &lt;&lt; tab_repl&lt;'.'&gt; &lt;&lt; tab_repl&lt;'.'&gt; &lt;&lt; &quot;Hallo&quot; &lt;&lt; std::endl;
}
</code></pre>
<p>Es läuft nur unter Windows und keine Ahnung, unter welchen Windowsen überhaupt die Tab-Weite von 8 stimmt. Achso, und es funktioniert natürlich nur mit Konsole, nicht mit Dateien oder ähnlichem Firlefanz <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/1566000</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1566000</guid><dc:creator><![CDATA[Badestrand]]></dc:creator><pubDate>Sat, 16 Aug 2008 14:48:24 GMT</pubDate></item><item><title><![CDATA[Reply to &#x5C;t durch &amp;quot;.&amp;quot; ersetzen?? on Sun, 17 Aug 2008 12:54:02 GMT]]></title><description><![CDATA[<p>dazu hab ich mal ne Frage.<br />
Ich hab ein fettes Packet an #includes in einer hpp datei, die ich am anfang einbinde<br />
mach ich dann den Code von dir &quot;Badestrand&quot;, dann bekomm ich Fehlermeldungen &quot;first use (...)&quot;<br />
wenn ich das packet nicht einbinde sondern nur iostream &amp; windows.h, dann geht es, obwohl im packet beide drinnen sind.<br />
woran zur h**** kann das liegen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1566380</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1566380</guid><dc:creator><![CDATA[3Stein]]></dc:creator><pubDate>Sun, 17 Aug 2008 12:54:02 GMT</pubDate></item><item><title><![CDATA[Reply to &#x5C;t durch &amp;quot;.&amp;quot; ersetzen?? on Sun, 17 Aug 2008 12:58:35 GMT]]></title><description><![CDATA[<p>3Stein schrieb:</p>
<blockquote>
<p>dazu hab ich mal ne Frage.<br />
Ich hab ein fettes Packet an #includes in einer hpp datei, die ich am anfang einbinde<br />
mach ich dann den Code von dir &quot;Badestrand&quot;, dann bekomm ich Fehlermeldungen &quot;first use (...)&quot;<br />
wenn ich das packet nicht einbinde sondern nur iostream &amp; windows.h, dann geht es, obwohl im packet beide drinnen sind.<br />
woran zur h**** kann das liegen?</p>
</blockquote>
<p>Header Guards?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1566381</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1566381</guid><dc:creator><![CDATA[drakon]]></dc:creator><pubDate>Sun, 17 Aug 2008 12:58:35 GMT</pubDate></item></channel></rss>