<?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[Wie Shell mit History erstellen?]]></title><description><![CDATA[<p>Vielleicht kennt jemand die Bash, eine Shell aus der UNIX Welt. Alle eingegebenen Befehle werden in eine Datei abgespeichert, so kann man später wieder alte Befehle mithilfe der nach Oben Pfeiltaste diese Selektieren und ausführen.</p>
<p>Ich möchte auch so eine Funktion in meine eigenen Shell implementieren, doch es wird wahrscheinlich viel Arbeit <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
<p>Ich habe folgenden Ansatz mit dem man Befehle einlesen kann, ganz simpel:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt; 
#include &lt;iostream&gt;
#include &lt;string&gt;

using namespace std;

int main()
{
	string Input;

	do 
	{
		cout &lt;&lt; &quot;Eingabe:&gt;&quot;;
		getline(cin, Input);

		if(Input == &quot;exit&quot;)
			return 0;

		//...

		else 
			cout &lt;&lt; &quot;Befehl unbekannt&quot; &lt;&lt; endl &lt;&lt; endl;

	} while(TRUE);

	return 0;
}
</code></pre>
<p>So, jetzt bräuchte ich euren Rat wie man bei der Eingabe gleichzeitig auf die Oben-Pfeiltaste warten kann und dann zum Test erstmal ein String ausgibt.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/186189/wie-shell-mit-history-erstellen</link><generator>RSS for Node</generator><lastBuildDate>Sun, 05 Jul 2026 03:22:33 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/186189.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 05 Jul 2007 21:39:13 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Wie Shell mit History erstellen? on Thu, 05 Jul 2007 21:39:13 GMT]]></title><description><![CDATA[<p>Vielleicht kennt jemand die Bash, eine Shell aus der UNIX Welt. Alle eingegebenen Befehle werden in eine Datei abgespeichert, so kann man später wieder alte Befehle mithilfe der nach Oben Pfeiltaste diese Selektieren und ausführen.</p>
<p>Ich möchte auch so eine Funktion in meine eigenen Shell implementieren, doch es wird wahrscheinlich viel Arbeit <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
<p>Ich habe folgenden Ansatz mit dem man Befehle einlesen kann, ganz simpel:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt; 
#include &lt;iostream&gt;
#include &lt;string&gt;

using namespace std;

int main()
{
	string Input;

	do 
	{
		cout &lt;&lt; &quot;Eingabe:&gt;&quot;;
		getline(cin, Input);

		if(Input == &quot;exit&quot;)
			return 0;

		//...

		else 
			cout &lt;&lt; &quot;Befehl unbekannt&quot; &lt;&lt; endl &lt;&lt; endl;

	} while(TRUE);

	return 0;
}
</code></pre>
<p>So, jetzt bräuchte ich euren Rat wie man bei der Eingabe gleichzeitig auf die Oben-Pfeiltaste warten kann und dann zum Test erstmal ein String ausgibt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1319290</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1319290</guid><dc:creator><![CDATA[kernel64]]></dc:creator><pubDate>Thu, 05 Jul 2007 21:39:13 GMT</pubDate></item><item><title><![CDATA[Reply to Wie Shell mit History erstellen? on Thu, 05 Jul 2007 22:57:00 GMT]]></title><description><![CDATA[<p>kernel64 schrieb:</p>
<blockquote>
<p>So, jetzt bräuchte ich euren Rat wie man bei der Eingabe gleichzeitig auf die Oben-Pfeiltaste warten kann und dann zum Test erstmal ein String ausgibt.</p>
</blockquote>
<p><code>getch()</code> ist dein Freund...</p>
<pre><code class="language-cpp">#include &lt;string&gt;
#include &lt;list&gt;
#include &lt;iostream&gt;

#include &lt;conio.h&gt;

using namespace std;

void clear_line( string::size_type length, const string &amp;prompt ) {

	cout.put( '\r' );

	for( string::size_type i = 0; i &lt; ( length + prompt.length( ) ); ++i ) {

		cout.put( ' ' );
	}

	cout &lt;&lt; '\r' &lt;&lt; prompt &lt;&lt; flush;
}

int main( ) {

	bool do_exit = false;
	list&lt; string &gt; history;
	const char prompt[ ] = &quot;:\\&quot;;

	do {

		cout &lt;&lt; prompt;

		string input;
		bool history_mode = false;
		list&lt; string &gt;::iterator current_history_item = history.begin( );
		int key;

		do {

			key = _getch( );

			if( ( key == 0x08 ) &amp;&amp; input.length( ) ) { // backspace

				clear_line( input.length( ), prompt );

				input.erase( input.length( ) - 1, 1 );
				cout &lt;&lt; input &lt;&lt; flush;

			} else if( key == 0x1b ) { // escape

				clear_line( input.length( ), prompt );
				history_mode = false;
				input = &quot;&quot;;

			} else if( key == 0xe0 ) { // steuerzeichen

				switch( _getch( ) ) {

					case 0x48: // arrow key: up

						if( current_history_item != history.end( ) ) {

							if( !history_mode ) {

								history_mode = true;

							} else {

								++current_history_item;
							}

							if( current_history_item != history.end( ) ) {

								clear_line( input.length( ), prompt );
								input = *current_history_item;
								cout &lt;&lt; input &lt;&lt; flush;
							}
						}

						break;

					case 0x50: // arrow key: down

						if( history_mode &amp;&amp; ( current_history_item != history.begin( ) ) ) {

							--current_history_item;

							clear_line( input.length( ), prompt );
							input = *current_history_item;
							cout &lt;&lt; input &lt;&lt; flush;
						}

						break;
				}

			} else if( key != '\r' ) {

				input += key;
				cout.put( key );
			}

		} while( key != '\r' ); // enter

		cout.put( '\n' );

		if( input.length( ) ) {

			history.push_front( input );
		}

		if( input == &quot;exit&quot; ) {

			do_exit = true;
		}

	} while( !do_exit );
}
</code></pre>
<p>...ist einigermaßen quick 'n dirty, sollte aber das Prinzip klarstellen.</p>
<p>greetz, Swordfish</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1319311</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1319311</guid><dc:creator><![CDATA[Swordfish]]></dc:creator><pubDate>Thu, 05 Jul 2007 22:57:00 GMT</pubDate></item><item><title><![CDATA[Reply to Wie Shell mit History erstellen? on Fri, 06 Jul 2007 08:39:37 GMT]]></title><description><![CDATA[<p>Ohhh vielen Dank, da hat sich jemand Mühe gemacht <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>
<p>Ich habe nun die eingegebenen Befehle in eine Datei gespeichert:</p>
<pre><code class="language-cpp">if( input.length( ) )
		{
			saveToHistory(input);
			history.push_front( input );			
		}
</code></pre>
<p>Hier die Funktion zum speichern:</p>
<pre><code class="language-cpp">void saveToHistory(string command)
{
	ofstream datei(&quot;history.txt&quot;, ios::app);
	if( !datei ) throw &quot;Fehler beim Öffnen!&quot;;

	datei &lt;&lt; command &lt;&lt; endl;
	datei.close();
}
</code></pre>
<p>Jetzt habe ich eine Funktion zum auslesen der strings:</p>
<pre><code class="language-cpp">string readFromHistory()
{
	ifstream datei(&quot;history.txt&quot;);
	string buffer;
	if( !datei ) throw &quot;Fehler beim Öffnen!&quot;;

	getline(datei, buffer,'\n');
	datei.close();

	return buffer;
}
</code></pre>
<p>Doch wie muss ich diese in der Switch Anweisung ber nach OBEN und UNTEN Pfeiltaste verwenden, ein Problem ist hierbei das immer nur der erste String ausgelesen wird, wahrscheinlich muss man den Code in der Switch Anweisung einbauen?!?!?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1319460</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1319460</guid><dc:creator><![CDATA[kernel64]]></dc:creator><pubDate>Fri, 06 Jul 2007 08:39:37 GMT</pubDate></item><item><title><![CDATA[Reply to Wie Shell mit History erstellen? on Fri, 06 Jul 2007 09:09:01 GMT]]></title><description><![CDATA[<p>Du brauchst die History nicht ständig aus der Datei lesen, sondern musst nur sicherstellen, dass jede Eingabe (die auch in der <code>list</code> landet) in die Datei geschrieben wird. Die History kannst du dann beim Programmstart in die <code>list</code> laden.</p>
<p>greetz, Swordfish</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1319501</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1319501</guid><dc:creator><![CDATA[Swordfish]]></dc:creator><pubDate>Fri, 06 Jul 2007 09:09:01 GMT</pubDate></item><item><title><![CDATA[Reply to Wie Shell mit History erstellen? on Fri, 06 Jul 2007 10:29:26 GMT]]></title><description><![CDATA[<p>Hab nun folgendes:</p>
<pre><code class="language-cpp">list&lt;string&gt; readHistory()
{
	list&lt; string &gt; history;
	ifstream datei(&quot;history.txt&quot;);

	string buffer;
	if( !datei ) throw &quot;Fehler beim Öffnen!&quot;;

	while (getline(datei, buffer, '\n')) 
	{			
		history.push_back(buffer);		
	}
	datei.close();
	return history;
}

int main( ) 
{	
	bool do_exit = false;
	const char prompt[ ] = &quot;:\\&quot;;

	list&lt; string &gt; history;
	history = readHistory();		

	do 
	{

		cout &lt;&lt; prompt;

		string input;
		bool history_mode = false;
		list&lt; string &gt;::iterator current_history_item = history.begin( );
		int key;

		do 
		{

			key = _getch( );

			//Backspace
			if( ( key == 0x08 ) &amp;&amp; input.length( ) ) 
			{ 

				clear_line( input.length( ), prompt );

				input.erase( input.length( ) - 1, 1 );
				cout &lt;&lt; input &lt;&lt; flush;

			} 

			//TAB
			else if( key == 0x09)
			{
				cout &lt;&lt; &quot;TAB&quot;;
			}

			//Escape
			else if( key == 0x1b ) 
			{ 

				clear_line( input.length( ), prompt );
				history_mode = false;
				input = &quot;&quot;;

			} 

			//Steuerzeichen
			else if( key == 0xe0 ) 
			{ 
				switch( _getch( ) ) 
				{
					case 0x48: // arrow key: up

						if( current_history_item != history.end( ) ) 
						{	
							if( !history_mode ) 
							{
								history_mode = true;								
							} 
							else 
							{
								++current_history_item;										
							}

							if( current_history_item != history.end( ) ) 
							{								
								clear_line( input.length( ), prompt );
								input = *current_history_item; 
								cout &lt;&lt; input &lt;&lt; flush;								
							}						
						}

						break;

					case 0x50: // arrow key: down

						if( history_mode &amp;&amp; ( current_history_item != history.begin( ) ) ) 
						{

							--current_history_item;

							clear_line( input.length( ), prompt );
							input = *current_history_item;
							cout &lt;&lt; input &lt;&lt; flush;
						}

						break;
				}

			} 
			else if( key != '\r' ) 
			{
				input += key;
				cout.put( key );
			}

		}while( key != '\r' ); // enter

		cout.put( '\n' );

		if( input.length( ) )
		{			
			history.push_front( input );			
			//Speichert Eingabe in History
			saveToHistory(input);
		}

		if( input == &quot;exit&quot; ) 
		{			
			do_exit = true;
		}

	} while( !do_exit );
}
</code></pre>
<p>Die Funktion readHistory liest die Datei aus und speichert es dann in eine Liste. Jetzt kann man die Liste von unten nach oben auslesen:</p>
<pre><code class="language-cpp">while (history.size() &gt; 0)
	{
		string str;
		str = history.back();
		cout &lt;&lt; &quot;Inhalt: &quot; &lt;&lt; str &lt;&lt; endl;
		history.pop_back();
	}
</code></pre>
<p>Wie baut man diesen Teil in den Code ein, in der Switch Anweisung oder an welcher Stelle???</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1319561</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1319561</guid><dc:creator><![CDATA[kernel64]]></dc:creator><pubDate>Fri, 06 Jul 2007 10:29:26 GMT</pubDate></item><item><title><![CDATA[Reply to Wie Shell mit History erstellen? on Fri, 06 Jul 2007 14:31:57 GMT]]></title><description><![CDATA[<p>Hallo, der Code mit der History Funktion funktioniert einwandfrei, muss mich wirklich bei dir bedanken <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="🙂"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /></p>
<p>So da ich schon immer die TAB-Vervollständigung auch implementieren wollte und es bisher nicht geschafft habe ich dein Code modifiziert und bin erstaunlich weit gekommen <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>
<pre><code class="language-cpp">int main( ) 
{	
	string HistoryFile = &quot;history.txt&quot;;
	bool do_exit = false;
	const char prompt[ ] = &quot;:\\&gt;&quot;;

	//Liste für History Befehle
	list&lt; string &gt; history;
	//Liste für Dateien/Verzeichniss
	list&lt; string &gt; listDir;

	if(checkFile(HistoryFile.c_str()))
	{
		history = readHistory(HistoryFile);
	}
	else
		cout &lt;&lt; &quot;History nicht gefunden&quot; &lt;&lt; endl;

	//Hole Dateien/Verzeichnisse
	listDir = getDirectory();

	do 
	{

		cout &lt;&lt; prompt;

		string input;
		bool history_mode = false;

		//Liste fängt am Anfang an
		list&lt; string &gt;::iterator current_file = listDir.begin();
		list&lt; string &gt;::iterator current_history_item = history.begin( );
		int key;

		do 
		{
			key = _getch( );

			//Backspace
			if( ( key == 0x08 ) &amp;&amp; input.length( ) ) 
			{ 

				clear_line( input.length( ), prompt );

				input.erase( input.length( ) - 1, 1 );
				cout &lt;&lt; input &lt;&lt; flush;

			} 

			//TAB-Vervollständigung
			else if( key == 0x09)
			{	
				if( current_file != listDir.end() )
				{	
					++current_file;	

					if( current_file != listDir.end( ) ) 
					{	
						clear_line( input.length( ), prompt );
						input = *current_file; 
						cout &lt;&lt; input &lt;&lt; flush;	
					}
					else
						current_file = listDir.begin();
				}				
			}

			//Escape
			else if( key == 0x1b ) 
			{ 

				clear_line( input.length( ), prompt );
				history_mode = false;
				input = &quot;&quot;;
			} 

			//Steuerzeichen
			else if( key == 0xe0 ) 
			{ 
				switch( _getch( ) ) 
				{
					case 0x48: // arrow key: up

						if( current_history_item != history.end( ) ) 
						{	
							if( !history_mode ) 
							{
								history_mode = true;								
							} 
							else 
							{
								++current_history_item;										
							}

							if( current_history_item != history.end( ) ) 
							{								
								clear_line( input.length( ), prompt );
								input = *current_history_item; 
								cout &lt;&lt; input &lt;&lt; flush;								
							}						
						}

						break;

					case 0x50: // arrow key: down

						if( history_mode &amp;&amp; ( current_history_item != history.begin( ) ) ) 
						{

							--current_history_item;

							clear_line( input.length( ), prompt );
							input = *current_history_item;
							cout &lt;&lt; input &lt;&lt; flush;
						}

						break;
				}

			} 
			else if( key != '\r' ) 
			{
				input += key;
				cout.put( key );
			}

		}while( key != '\r' ); // enter

		cout.put( '\n' );

		if( input.length( ) )
		{			
			history.push_front( input );			
			//Speichert Eingabe in History
			saveToHistory(input);
		}

		if( input == &quot;exit&quot; ) 
		{			
			do_exit = true;
		}

	} while( !do_exit );
}
</code></pre>
<p>Wenn ich nun TAB drücke werden nacheinander die Dateien und Verzeichnisse aufgelistet, doch sobald ich den Befehl <strong>cd</strong> eingabe und dann TAB drücke wird dieser überschrieben, da die clear_line() Funktion aufgerufen wird, wie kann man an der aktuelle Cursor position die Verzeichnisse ausgeben lassen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1319781</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1319781</guid><dc:creator><![CDATA[kernel64]]></dc:creator><pubDate>Fri, 06 Jul 2007 14:31:57 GMT</pubDate></item><item><title><![CDATA[Reply to Wie Shell mit History erstellen? on Sat, 07 Jul 2007 01:43:17 GMT]]></title><description><![CDATA[<p>So langsam komme ich voran <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="🙂"
    /><br />
Hier die verbesserte Version:</p>
<pre><code class="language-cpp">int main( ) 
{	
	string HistoryFile = &quot;history.txt&quot;;
	bool do_exit = false;
	const char prompt[ ] = &quot;:\\&gt;&quot;;

	//Liste für History Befehle
	list&lt; string &gt; history;
	//Liste für Dateien/Verzeichniss
	list&lt; string &gt; listDir;

	if(checkFile(HistoryFile.c_str()))
	{
		history = readHistory(HistoryFile);
	}

	//Hole Dateien/Verzeichnisse
	listDir = getDirectory();

	HANDLE std_output = GetStdHandle( STD_OUTPUT_HANDLE );
	CONSOLE_SCREEN_BUFFER_INFO console_screen_buffer_info;

	do 
	{

		cout &lt;&lt; prompt;

		string input;
		string getTabOutput;
		bool history_mode = false;
		bool TAB_MODE = false;

		list&lt; string &gt;::iterator current_file = listDir.begin();
		list&lt; string &gt;::iterator current_history_item = history.begin( );
		int key;

		do 
		{
			key = _getch( );

			//Backspace
			if( ( key == 0x08 ) &amp;&amp; input.length( ) ) 
			{ 

				clear_line( input.length( ), prompt );

				input.erase( input.length( ) - 1, 1 );
				cout &lt;&lt; input &lt;&lt; flush;

			} 

			//TAB-Vervollständigung
			else if( key == 0x09)
			{	
				//Speichert Ausgabe in History
				TAB_MODE = true;

				if( current_file != listDir.end() )
				{
					++current_file;	

					if( current_file != listDir.end( ) ) 
					{							
						string FileObject = *current_file;
						getTabOutput = clear_TabInput(input, prompt, FileObject);
						cout &lt;&lt; getTabOutput &lt;&lt; flush;						
					}
					else
						current_file = listDir.begin();
				}				
			}

			else if( key == 0x0E &amp;&amp; key == 0x09)
			{
				cout &lt;&lt; &quot;SHIFT&quot; &lt;&lt; endl;
			}

			//Escape
			else if( key == 0x1b ) 
			{ 
				clear_line( input.length( ), prompt );
				history_mode = false;
				input = &quot;&quot;;
			} 

			//Steuerzeichen
			else if( key == 0xe0 ) 
			{ 
				switch( _getch( ) ) 
				{
					int x, y;
					case 0x48: // Pfeiltaste nach Oben

						if( current_history_item != history.end( ) ) 
						{	
							if( !history_mode ) 
							{
								history_mode = true;								
							} 
							else 
							{
								++current_history_item;										
							}

							if( current_history_item != history.end( ) ) 
							{								
								clear_line( input.length( ), prompt );
								input = *current_history_item; 
								cout &lt;&lt; input &lt;&lt; flush;								
							}						
						}
						break;

					case 0x50: // Pfeiltaste nach Unten

						if( history_mode &amp;&amp; ( current_history_item != history.begin( ) ) ) 
						{
							--current_history_item;

							clear_line( input.length( ), prompt );
							input = *current_history_item;
							cout &lt;&lt; input &lt;&lt; flush;
						}
						break;

					case 0x4B: // Pfeiltaste nach Links						

						GetConsoleScreenBufferInfo( std_output, &amp;console_screen_buffer_info );
						x = console_screen_buffer_info.dwCursorPosition.X;
						y = console_screen_buffer_info.dwCursorPosition.Y; 

						gotoxy(x-1, y);

						break;

					case 0x4D: // Pfeiltaste nach Rechts						

						GetConsoleScreenBufferInfo( std_output, &amp;console_screen_buffer_info );
						x = console_screen_buffer_info.dwCursorPosition.X;
						y = console_screen_buffer_info.dwCursorPosition.Y; 

						gotoxy(x+1, y);

						break;
				}

			} 
			else if( key != '\r' ) 
			{
				input += key;
				cout.put( key );				
			}

			else if( key == '\r')
			{				
				if(TAB_MODE)
					saveToHistory(getTabOutput);
				else
					saveToHistory(input);
			}

		}while( key != '\r' ); // enter

		cout.put( '\n' );

		if( input.length( ) )
		{		
			if(TAB_MODE)
				history.push_front( getTabOutput);
			else				
				history.push_front( input );				
		}

		if( input == &quot;exit&quot; ) 
		{			
			do_exit = true;
		}

	} while( !do_exit );
}
</code></pre>
<p>Jetzt habe ich noch die LINKE &amp; RECHTE PFEILTASTE eingebaut um in dem eingegebenem string zu navigieren, mithilfe von gotoxy() kann ich nun an die gewünschte Position gelangen. Wenn ich nun die Leertaste drücke wird der Input gelöscht also das jeweilige Zeichen, z.B. ich als Input = &quot;hallo test**<em><strong>&quot;<br />
Jetzt möchte ich mit dem Cursor vorm &quot;test&quot; = &quot;</strong></em>**test&quot; wenn ich hier Leertaste drücke steht folgendes: &quot; _est&quot; es wird alles verschlungen, wie kann man das verhindern?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1320039</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1320039</guid><dc:creator><![CDATA[kernel64]]></dc:creator><pubDate>Sat, 07 Jul 2007 01:43:17 GMT</pubDate></item></channel></rss>