<?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[c++ text datei]]></title><description><![CDATA[<p>Hallo<br />
Ich arbeite an einen programm dass mit dem system(ipconfig); daten aus gibt und möchte diese in eine txt datei speichern wie geht dass????<br />
danke im vorraus</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/240121/c-text-datei</link><generator>RSS for Node</generator><lastBuildDate>Tue, 22 Sep 2026 03:41:59 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/240121.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 02 May 2009 11:01:25 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to c++ text datei on Sat, 02 May 2009 11:01:25 GMT]]></title><description><![CDATA[<p>Hallo<br />
Ich arbeite an einen programm dass mit dem system(ipconfig); daten aus gibt und möchte diese in eine txt datei speichern wie geht dass????<br />
danke im vorraus</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1704371</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1704371</guid><dc:creator><![CDATA[Dennis1232323]]></dc:creator><pubDate>Sat, 02 May 2009 11:01:25 GMT</pubDate></item><item><title><![CDATA[Reply to c++ text datei on Sat, 02 May 2009 13:29:51 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">system(&quot;ipconfig &gt; ipconfig.txt&quot;);
</code></pre>
<p>Und dann zur laufzeit die datei auslesen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1704447</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1704447</guid><dc:creator><![CDATA[Firefighter]]></dc:creator><pubDate>Sat, 02 May 2009 13:29:51 GMT</pubDate></item><item><title><![CDATA[Reply to c++ text datei on Sun, 03 May 2009 09:21:37 GMT]]></title><description><![CDATA[<p>Klpappt Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1704688</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1704688</guid><dc:creator><![CDATA[Dennis123232]]></dc:creator><pubDate>Sun, 03 May 2009 09:21:37 GMT</pubDate></item><item><title><![CDATA[Reply to c++ text datei on Sun, 03 May 2009 09:24:16 GMT]]></title><description><![CDATA[<p>Ich bins nochmal es gibt ein Problem ich benutze Vista und da werden ganz viele Datein gespeichert und ich möchte nur die ip auslesen wie geht das ????</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1704689</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1704689</guid><dc:creator><![CDATA[Dennis13232]]></dc:creator><pubDate>Sun, 03 May 2009 09:24:16 GMT</pubDate></item><item><title><![CDATA[Reply to c++ text datei on Sun, 03 May 2009 10:14:29 GMT]]></title><description><![CDATA[<p>Dennis13232 schrieb:</p>
<blockquote>
<p>(...( und da werden ganz viele Datein gespeichert (...)</p>
</blockquote>
<p>Gehts vielleicht genauer?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1704712</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1704712</guid><dc:creator><![CDATA[xy]]></dc:creator><pubDate>Sun, 03 May 2009 10:14:29 GMT</pubDate></item><item><title><![CDATA[Reply to c++ text datei on Sun, 03 May 2009 10:16:45 GMT]]></title><description><![CDATA[<p>Srry ich will nur die IP auslesen und da werden ja auchdns gate way ect. gespeichert und ich will nur die ip haben (danke für alle die sich bemhen meine schlechten Posts so gut wie möglich zu beantworten)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1704713</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1704713</guid><dc:creator><![CDATA[Dennis12323]]></dc:creator><pubDate>Sun, 03 May 2009 10:16:45 GMT</pubDate></item><item><title><![CDATA[Reply to c++ text datei on Sun, 03 May 2009 10:52:29 GMT]]></title><description><![CDATA[<p>Dennis12323 schrieb:</p>
<blockquote>
<p>Srry ich will nur die IP auslesen und da werden ja auchdns gate way ect. gespeichert und ich will nur die ip haben (danke für alle die sich bemhen meine schlechten Posts so gut wie möglich zu beantworten)</p>
</blockquote>
<p>Na du liest die Datei ein... zwar habe ich kein Windows aber auch du müsstest da drinnen sowas ähnliches stehen haben:</p>
<blockquote>
<p>wlan0 Protokoll:Ethernet Hardware Adresse 00:1f:3c:94:8a:31<br />
inet Adresse:192.168.0.8 Bcast:192.168.0.255 Maske:255.255.255.0<br />
inet6 Adresse: fe80::21f:3cff:fe94:8a31/64 Gültigkeitsbereich:Verbindung<br />
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1<br />
RX packets:232107 errors:0 dropped:0 overruns:0 frame:0<br />
TX packets:134685 errors:0 dropped:0 overruns:0 carrier:0<br />
Kollisionen:0 Sendewarteschlangenlänge:1000<br />
RX bytes:336953888 (321.3 MiB) TX bytes:11900660 (11.3 MiB)</p>
</blockquote>
<p>Dann liest du die Datei Zeile für Zeile und suchst nach dem Ausdruck &quot;inet Adresse:&quot; (kann bei dir auch anders heissen) Wenn du den gefunden hast liest du den nachfolgenden Text bis zum nächsten Whitespace ... und bekommst den String:<br />
192.168.0.8<br />
Schau dir fstream an (datei lesen) und beschäftige dich mit der std::string api</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1704732</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1704732</guid><dc:creator><![CDATA[xy]]></dc:creator><pubDate>Sun, 03 May 2009 10:52:29 GMT</pubDate></item><item><title><![CDATA[Reply to c++ text datei on Sun, 03 May 2009 10:58:20 GMT]]></title><description><![CDATA[<p>lass einfach den system(&quot;...&quot;) kack und verwende Windows Sockets,<br />
wenn du eh Windows benutzt als OS :p</p>
<p>hier Beispielcode (ermittelt deine IP-Adresse)</p>
<pre><code class="language-cpp">#define WIN32_LEAN_AND_MEAN
#include &lt;Windows.h&gt;
#include &lt;WinSock2.h&gt;

#include &lt;iostream&gt;

int main(void)
{
	// Winsock starten
	WSADATA data;
	WSAStartup(MAKEWORD(2, 2), &amp;data);
	// Name ermitteln
	char name[64];
	gethostname(name, 64);
	std::cout &lt;&lt; &quot;Rechnername: &quot; &lt;&lt; name &lt;&lt; std::endl;
	// Hostname auflösen
	hostent *info = gethostbyname(name);
	in_addr addr;
	// IP-Adresse ausgeben
	int n = 0;
	do 
	{
		addr.s_addr = *(reinterpret_cast&lt;unsigned long*&gt;(info-&gt;h_addr_list[n]));
		std::cout &lt;&lt; &quot;IP-Adresse Nr. &quot; &lt;&lt; (n + 1) &lt;&lt; &quot;: &quot; &lt;&lt; inet_ntoa(addr) &lt;&lt; std::endl;
		++n;
	} while (info-&gt;h_addr_list[n] != 0);
	std::cin.get();
	// Winsock beenden
	WSACleanup();
	return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1704736</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1704736</guid><dc:creator><![CDATA[DrakoXP]]></dc:creator><pubDate>Sun, 03 May 2009 10:58:20 GMT</pubDate></item><item><title><![CDATA[Reply to c++ text datei on Sun, 03 May 2009 10:55:22 GMT]]></title><description><![CDATA[<p>DrakoXP schrieb:</p>
<blockquote>
<p>lass einfach den system(&quot;...&quot;) kack und verwende Windows Sockets,<br />
wenn du eh Windows benutzt als OS :p</p>
<p>hier Beispielcode (ermittelt deine IP-Adresse)</p>
<pre><code class="language-cpp">#define WIN32_LEAN_AND_MEAN
#include &lt;Windows.h&gt;
#include &lt;WinSock2.h&gt;

#include &lt;iostream&gt;

int main(void)
{
	// Winsock starten
	WSADATA data;
	WSAStartup(MAKEWORD(2, 2), &amp;data);
	// Name ermitteln
	char name[64];
	gethostname(name, 64);
	// Hostname auflösen
	hostent *info = gethostbyname(name);
	in_addr addr;
	addr.s_addr = *(reinterpret_cast&lt;unsigned long*&gt;(info-&gt;h_addr_list[0]));
	// IP-Adresse ausgeben
	std::cout &lt;&lt; inet_ntoa(addr);
	std::cin.get();
	// Winsock beenden
	WSACleanup();
	return 0;
}
</code></pre>
</blockquote>
<p>Das ist nichts windows spezifisches :p<br />
gethostbyname und gethostname gibts überall <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1704739</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1704739</guid><dc:creator><![CDATA[HAHA]]></dc:creator><pubDate>Sun, 03 May 2009 10:55:22 GMT</pubDate></item><item><title><![CDATA[Reply to c++ text datei on Sun, 03 May 2009 11:01:32 GMT]]></title><description><![CDATA[<p>WSADATA, WSAStartup und WSACleanup aber nicht.<br />
und aus den Posts des Fragestellers meinte ich eine gewisse Unerfahrenheit erkennen zu können <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";-)"
      alt="😉"
    /></p>
<p>ganz davon abgesehen, dass man unter Linux wesentlich mehr Header inkludieren muss xD</p>
<p>vielleicht sollte ich noch erwähnen, dass mein Programmcode noch mit der ws2_32.lib gelinkt werden muss,<br />
sonst gibs Linker-Error</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1704742</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1704742</guid><dc:creator><![CDATA[DrakoXP]]></dc:creator><pubDate>Sun, 03 May 2009 11:01:32 GMT</pubDate></item><item><title><![CDATA[Reply to c++ text datei on Sun, 03 May 2009 11:27:08 GMT]]></title><description><![CDATA[<p>So ermal wieder Danke hab mich mit fstream beschäftigt aber bekomme immernoch nicht hin wie ich eine bestimmte zeile auslese mit getline ??</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1704760</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1704760</guid><dc:creator><![CDATA[Dennis12323]]></dc:creator><pubDate>Sun, 03 May 2009 11:27:08 GMT</pubDate></item><item><title><![CDATA[Reply to c++ text datei on Sun, 03 May 2009 11:39:14 GMT]]></title><description><![CDATA[<p>Dennis12323 schrieb:</p>
<blockquote>
<p>So ermal wieder Danke hab mich mit fstream beschäftigt aber bekomme immernoch nicht hin wie ich eine bestimmte zeile auslese mit getline ??</p>
</blockquote>
<p>Du hast dich also zu wenig mit <code>std::fstream</code> beschäftigt.</p>
<p>Such mal bei <a href="http://www.cplusplus.com" rel="nofollow">www.cplusplus.com</a> - dort sind die benötigten Klassen und Funktionen gut erklärt, oft sogar mit Codebeispiel.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1704764</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1704764</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Sun, 03 May 2009 11:39:14 GMT</pubDate></item><item><title><![CDATA[Reply to c++ text datei on Sun, 03 May 2009 11:43:50 GMT]]></title><description><![CDATA[<p>wieso willst du das mit nem fstream aus einer Datei auslesen? xD</p>
<p>hast du dir <a href="http://www.c-plusplus.net/forum/viewtopic-var-p-is-1704736.html#1704736" rel="nofollow">meinen Code</a> überhaupt mal angeschaut?</p>
<p>inet_ntoa liefert dir die IP-Adresse in einem schönen C-String im Format &quot;<a href="http://xxx.xxx.xxx.xxx" rel="nofollow">xxx.xxx.xxx.xxx</a>&quot;<br />
und wenn du's als C++-String brauchst machste einfach</p>
<pre><code class="language-cpp">std::string strAddr(inet_ntoa(addr));
</code></pre>
<p>und falls dich das mit dem info-&gt;h_addr_list usw. verwirrt:<br />
h_addr_list ist eine Liste aller IP-Adressen deines Rechners<br />
(dein Rechner kann durchaus mehrere IP-Adressen haben).</p>
<p>der letzte Eintrag dieser Liste hat den Wert 0, deshalb wird bis dahin alles hintereinander ausgegeben<br />
und dann beendet.</p>
<p>MfG Drako</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1704765</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1704765</guid><dc:creator><![CDATA[DrakoXP]]></dc:creator><pubDate>Sun, 03 May 2009 11:43:50 GMT</pubDate></item><item><title><![CDATA[Reply to c++ text datei on Sun, 03 May 2009 11:47:38 GMT]]></title><description><![CDATA[<p>Ja hab mir deinen Code angeluckt aber hab ihn nicht recht verstanden und deswegen wollt ich ihn nicht benutzen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1704767</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1704767</guid><dc:creator><![CDATA[Dennis12323]]></dc:creator><pubDate>Sun, 03 May 2009 11:47:38 GMT</pubDate></item><item><title><![CDATA[Reply to c++ text datei on Sun, 03 May 2009 11:51:40 GMT]]></title><description><![CDATA[<p>ICh glaub das das nichts mehr bringen wird und ich mich erstnochmal weiter mit dehm Thema beschäftigen sollte danke trozdem</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1704772</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1704772</guid><dc:creator><![CDATA[Dennis12323]]></dc:creator><pubDate>Sun, 03 May 2009 11:51:40 GMT</pubDate></item><item><title><![CDATA[Reply to c++ text datei on Sun, 03 May 2009 11:52:38 GMT]]></title><description><![CDATA[<p>Du hättest auch nachfragen können, wenn du etwas nicht verstehst...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1704775</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1704775</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Sun, 03 May 2009 11:52:38 GMT</pubDate></item></channel></rss>