<?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[Programm zum datenschreiben..]]></title><description><![CDATA[<p>Hi Leute,</p>
<p>ich schreibe an 2 Programmen. Das Erst soll Daten (von Benutzer eingegeben) schreiben und speicher und das Zweite soll die Daten lesen. Nur is das Programm zum Daten schreiben irgentwie falsch gecodet. Ich finde im Internet keine Antwort daruf wie ich es machen soll.<br />
Ich kann die Eingebenen Daten nur lesen, wenn es Ziffern sind. Sobald ich Buchstaben eingebe werden die nicht gespeichert. Obwohl ich mit strings arbeite. Das Programm soll am Ende mal irgentwann eine Kundendatenbank werden.</p>
<p>Der Quellcode ist:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;ostream&gt;
#include &lt;fstream&gt;
#include &lt;string&gt;

using namespace std;

const char* const kDatei = &quot;Kunden.dat&quot;;
short kNr, hNr;
char string[50000] name, str, plz_Ort, e_Mail;
double tel;

int main()
{
	system(&quot;clear&quot;);
	cout &lt;&lt; &quot;\nKundenDatenbank 0.1.5 (Speichern)&quot; &lt;&lt; endl;
	cout &lt;&lt; &quot;\n\nKundenNr.: &quot;;
	cin  &gt;&gt; kNr;
	cout &lt;&lt; &quot;\n\nName_Vorname: &quot;;
	cin  &gt;&gt; name;
	cout &lt;&lt; &quot;\nStraße: &quot;;
	cin  &gt;&gt; str;
	cout &lt;&lt; &quot;HNr.: &quot;;
	cin  &gt;&gt; hNr;
	cout &lt;&lt; &quot;\nPLZ_Ort: &quot;;
	cin  &gt;&gt; plz_Ort;
	cout &lt;&lt; &quot;\nTelefon: &quot;;
	cin  &gt;&gt; tel;
	cout &lt;&lt; &quot;\nEmail: &quot;;
	cin  &gt;&gt; e_Mail; 

	{
		ofstream outFile(kDatei);
		if (!outFile)
		   { cout &lt;&lt; &quot;Error: Fehler beim Erstellen der Datei!\n\n&quot;;     exit(1); }

		outFile &lt;&lt; kNr &lt;&lt; &quot; &quot; &lt;&lt; name &lt;&lt; &quot; &quot; &lt;&lt; str &lt;&lt; &quot; &quot; &lt;&lt; hNr &lt;&lt; &quot; &quot; &lt;&lt; plz_Ort &lt;&lt; endl;
		outFile &lt;&lt; tel &lt;&lt; &quot; &quot; &lt;&lt; e_Mail &lt;&lt; endl;		
	}

	return(0);
}
</code></pre>
<p>Gruß Metapoint <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/topic/276160/programm-zum-datenschreiben</link><generator>RSS for Node</generator><lastBuildDate>Wed, 26 Aug 2026 14:44:03 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/276160.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 27 Oct 2010 19:22:33 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Programm zum datenschreiben.. on Wed, 27 Oct 2010 19:22:33 GMT]]></title><description><![CDATA[<p>Hi Leute,</p>
<p>ich schreibe an 2 Programmen. Das Erst soll Daten (von Benutzer eingegeben) schreiben und speicher und das Zweite soll die Daten lesen. Nur is das Programm zum Daten schreiben irgentwie falsch gecodet. Ich finde im Internet keine Antwort daruf wie ich es machen soll.<br />
Ich kann die Eingebenen Daten nur lesen, wenn es Ziffern sind. Sobald ich Buchstaben eingebe werden die nicht gespeichert. Obwohl ich mit strings arbeite. Das Programm soll am Ende mal irgentwann eine Kundendatenbank werden.</p>
<p>Der Quellcode ist:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;ostream&gt;
#include &lt;fstream&gt;
#include &lt;string&gt;

using namespace std;

const char* const kDatei = &quot;Kunden.dat&quot;;
short kNr, hNr;
char string[50000] name, str, plz_Ort, e_Mail;
double tel;

int main()
{
	system(&quot;clear&quot;);
	cout &lt;&lt; &quot;\nKundenDatenbank 0.1.5 (Speichern)&quot; &lt;&lt; endl;
	cout &lt;&lt; &quot;\n\nKundenNr.: &quot;;
	cin  &gt;&gt; kNr;
	cout &lt;&lt; &quot;\n\nName_Vorname: &quot;;
	cin  &gt;&gt; name;
	cout &lt;&lt; &quot;\nStraße: &quot;;
	cin  &gt;&gt; str;
	cout &lt;&lt; &quot;HNr.: &quot;;
	cin  &gt;&gt; hNr;
	cout &lt;&lt; &quot;\nPLZ_Ort: &quot;;
	cin  &gt;&gt; plz_Ort;
	cout &lt;&lt; &quot;\nTelefon: &quot;;
	cin  &gt;&gt; tel;
	cout &lt;&lt; &quot;\nEmail: &quot;;
	cin  &gt;&gt; e_Mail; 

	{
		ofstream outFile(kDatei);
		if (!outFile)
		   { cout &lt;&lt; &quot;Error: Fehler beim Erstellen der Datei!\n\n&quot;;     exit(1); }

		outFile &lt;&lt; kNr &lt;&lt; &quot; &quot; &lt;&lt; name &lt;&lt; &quot; &quot; &lt;&lt; str &lt;&lt; &quot; &quot; &lt;&lt; hNr &lt;&lt; &quot; &quot; &lt;&lt; plz_Ort &lt;&lt; endl;
		outFile &lt;&lt; tel &lt;&lt; &quot; &quot; &lt;&lt; e_Mail &lt;&lt; endl;		
	}

	return(0);
}
</code></pre>
<p>Gruß Metapoint <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/1971696</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1971696</guid><dc:creator><![CDATA[metapoint]]></dc:creator><pubDate>Wed, 27 Oct 2010 19:22:33 GMT</pubDate></item><item><title><![CDATA[Reply to Programm zum datenschreiben.. on Wed, 27 Oct 2010 19:27:56 GMT]]></title><description><![CDATA[<p>bei den datentypen habe ich normal string stehen gehabt, statt char string[500000]. Das war nurn test obs dann geht... Leider hats nicht geklappt <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1971701</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1971701</guid><dc:creator><![CDATA[ffa]]></dc:creator><pubDate>Wed, 27 Oct 2010 19:27:56 GMT</pubDate></item><item><title><![CDATA[Reply to Programm zum datenschreiben.. on Wed, 27 Oct 2010 19:33:44 GMT]]></title><description><![CDATA[<p>char string[50000] ist kein string. Das ist ein Array.<br />
Benutz mal std::string.<br />
rya.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1971706</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1971706</guid><dc:creator><![CDATA[[[global:former_user]]]]></dc:creator><pubDate>Wed, 27 Oct 2010 19:33:44 GMT</pubDate></item><item><title><![CDATA[Reply to Programm zum datenschreiben.. on Thu, 28 Oct 2010 06:24:40 GMT]]></title><description><![CDATA[<p>Versuchs mal damit :</p>
<pre><code class="language-cpp">ofstream Zieldatei(&quot;Datei.txt&quot;);
Zieldatei &lt;&lt; &quot;Dies ist der neue Text\n&quot;;
Zieldatei.close();
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1971788</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1971788</guid><dc:creator><![CDATA[Unbenannt]]></dc:creator><pubDate>Thu, 28 Oct 2010 06:24:40 GMT</pubDate></item></channel></rss>