<?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[Brauche hilfe bei meinem ersten Programm?]]></title><description><![CDATA[<p>Hallo!</p>
<p>Ich habe vor 2 Wochen angefangen mit C++ zu arbeiten und bin eigentlich noch ein richtiger Anfänger <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>Derzeit arbeite ich an einem kleinen Programm zu erstellen von bestimmten .sql Dateien. Doch ich kann das noch nicht so .... ich habe hier unten meinen C++ Code geposten und ich wollte fragen was ich ergänzen muss, damit die folgenden Sachen funktionieren:</p>
<p>1. Wenn ich es so ausführe kann ich nur in Name etwas hineinschreiben, doch wenn ich ENTER drücke erscheint plötlich alles in einer zweile und ich kann nichts mehr schreiebn. Probierts mal aus dann seht ihr was ich meine.</p>
<p>2. Wie bekomme ich das was ich hineinschreibe, hald dann im Programm, am ende in eine SQL Datein? Wie z.B so .... wenn ich bei Name: TOMTOM hinein schreibe, dass es so &quot;insert into `creature_template` (`TOMTOM`) &quot; auch in der SQL Datei steht.</p>
<p>Sicher lachen sich die meisten von euch gleich tod, wenn ihr meinen Code seht, doch ich bin noch anfänger und hab das einfach mal so wie ich glaube hingeschrieben XD</p>
<pre><code class="language-cpp">//NPC Maker.cpp

#include &lt;StdAfx.h&gt;
#include &lt;iostream&gt;
using namespace std;

int main()
{
	int Name;
	int Subname;
	int Rank;
	int Entry;
	int DisplayID;
	int Faction;
	int Größe;
	int WalkSpeed;
	int RunSpeed;
	int RespawnTimer;
	int Rüstung;
	int Mana;
	int Lebenmin ;
	int Lebenmax ;
	int Levelmin ;
	int Levelmax ;
	int Schadenmin ;
	int Schadenmax ;
	int Heilig;
	int Natur;
	int Schatten;
    int Feuer;
	int Frost;
	int Arkan;
	int Optionen;
	int Loot;

	cout &lt;&lt; &quot; NPC Name: &quot; ;
	cin  &gt;&gt; Name;

	cout &lt;&lt; &quot; NPC Subname: &quot; ; 
	cin  &gt;&gt; Subname;

	cout &lt;&lt; &quot; NPC Rang ,schreibe 0 fuer normal, 1 fuer elite, 2 fuer rar elite, 3 fuer world boss, 4 fuer rar, : &quot; ; 
	cin  &gt;&gt; Rank;

	cout &lt;&lt; &quot; Entry ID: &quot; ; 
	cin  &gt;&gt; Entry;

	cout &lt;&lt; &quot; Display ID: &quot; ; 
	cin  &gt;&gt; DisplayID;

	cout &lt;&lt; &quot;NPC Faction ( schreibe 7 für neutral, 14 für feindlich, 35 für Freundlich: &quot; ;
	cin  &gt;&gt; Faction ;

	cout &lt;&lt; &quot;NPC Größe: &quot; ;
	cin  &gt;&gt; Größe;

	cout &lt;&lt; &quot;WalkSpeed (am besten 2.50): &quot; ;
	cin &gt;&gt; WalkSpeed;

    cout &lt;&lt; &quot;RunSpeed (am besten 8.00): &quot; ;
	cin  &gt;&gt; RunSpeed;

	cout &lt;&lt; &quot;NPC Rüstung: &quot; ;
	cin  &gt;&gt; Rüstung;

	cout &lt;&lt; &quot;NPC Mana: &quot;;
	cin  &gt;&gt; Mana;

	cout &lt;&lt; &quot;Leben min.: &quot; ;
	cin  &gt;&gt; Lebenmin;

	cout &lt;&lt; &quot;Leben max.: &quot;;
	cin  &gt;&gt; Lebenmax;

	cout &lt;&lt; &quot;Level min.: &quot;;
	cin  &gt;&gt; Levelmin;

	cout &lt;&lt; &quot;Level max.: &quot;;
	cin  &gt;&gt; Levelmin;

	cout &lt;&lt; &quot;Schaden min.: &quot;;
	cin  &gt;&gt; Schadenmin;

	cout &lt;&lt; &quot;Schaden max.: &quot;;
	cin  &gt;&gt; Schadenmax;

	cout &lt;&lt; &quot;res. Heilig: &quot; ;
	cin  &gt;&gt; Heilig;

	cout &lt;&lt; &quot;res. Natur: &quot; ;
	cin  &gt;&gt; Natur;

	cout &lt;&lt; &quot;res. Schatten: &quot; ;
	cin  &gt;&gt; Schatten;

	cout &lt;&lt; &quot;res. Feuer: &quot; ;
	cin  &gt;&gt; Feuer;

	cout &lt;&lt; &quot;res. Frost: &quot; ;
	cin  &gt;&gt; Frost;

    cout &lt;&lt; &quot;res. Arkan: &quot; ;
	cin  &gt;&gt; Arkan;

	cout &lt;&lt; &quot;NPC Optionen (Gossip:1/ Vendor:129/ Armorer:4097/ Gastwirt:65537/ Banker:131073 / Auction:2097153) :  &quot; ;
	cin  &gt;&gt; Optionen;

	cout &lt;&lt; &quot;Gold: &quot;;
	cin  &gt;&gt; Loot;

	system(&quot;PAUSE&quot;);

	return 0;

}
</code></pre>
<p>Hoffe auf schnelle Antwort ....</p>
<p>MfG Andreas</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/268342/brauche-hilfe-bei-meinem-ersten-programm</link><generator>RSS for Node</generator><lastBuildDate>Tue, 01 Sep 2026 21:04:10 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/268342.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 07 Jun 2010 19:58:43 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Brauche hilfe bei meinem ersten Programm? on Mon, 07 Jun 2010 19:58:43 GMT]]></title><description><![CDATA[<p>Hallo!</p>
<p>Ich habe vor 2 Wochen angefangen mit C++ zu arbeiten und bin eigentlich noch ein richtiger Anfänger <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>Derzeit arbeite ich an einem kleinen Programm zu erstellen von bestimmten .sql Dateien. Doch ich kann das noch nicht so .... ich habe hier unten meinen C++ Code geposten und ich wollte fragen was ich ergänzen muss, damit die folgenden Sachen funktionieren:</p>
<p>1. Wenn ich es so ausführe kann ich nur in Name etwas hineinschreiben, doch wenn ich ENTER drücke erscheint plötlich alles in einer zweile und ich kann nichts mehr schreiebn. Probierts mal aus dann seht ihr was ich meine.</p>
<p>2. Wie bekomme ich das was ich hineinschreibe, hald dann im Programm, am ende in eine SQL Datein? Wie z.B so .... wenn ich bei Name: TOMTOM hinein schreibe, dass es so &quot;insert into `creature_template` (`TOMTOM`) &quot; auch in der SQL Datei steht.</p>
<p>Sicher lachen sich die meisten von euch gleich tod, wenn ihr meinen Code seht, doch ich bin noch anfänger und hab das einfach mal so wie ich glaube hingeschrieben XD</p>
<pre><code class="language-cpp">//NPC Maker.cpp

#include &lt;StdAfx.h&gt;
#include &lt;iostream&gt;
using namespace std;

int main()
{
	int Name;
	int Subname;
	int Rank;
	int Entry;
	int DisplayID;
	int Faction;
	int Größe;
	int WalkSpeed;
	int RunSpeed;
	int RespawnTimer;
	int Rüstung;
	int Mana;
	int Lebenmin ;
	int Lebenmax ;
	int Levelmin ;
	int Levelmax ;
	int Schadenmin ;
	int Schadenmax ;
	int Heilig;
	int Natur;
	int Schatten;
    int Feuer;
	int Frost;
	int Arkan;
	int Optionen;
	int Loot;

	cout &lt;&lt; &quot; NPC Name: &quot; ;
	cin  &gt;&gt; Name;

	cout &lt;&lt; &quot; NPC Subname: &quot; ; 
	cin  &gt;&gt; Subname;

	cout &lt;&lt; &quot; NPC Rang ,schreibe 0 fuer normal, 1 fuer elite, 2 fuer rar elite, 3 fuer world boss, 4 fuer rar, : &quot; ; 
	cin  &gt;&gt; Rank;

	cout &lt;&lt; &quot; Entry ID: &quot; ; 
	cin  &gt;&gt; Entry;

	cout &lt;&lt; &quot; Display ID: &quot; ; 
	cin  &gt;&gt; DisplayID;

	cout &lt;&lt; &quot;NPC Faction ( schreibe 7 für neutral, 14 für feindlich, 35 für Freundlich: &quot; ;
	cin  &gt;&gt; Faction ;

	cout &lt;&lt; &quot;NPC Größe: &quot; ;
	cin  &gt;&gt; Größe;

	cout &lt;&lt; &quot;WalkSpeed (am besten 2.50): &quot; ;
	cin &gt;&gt; WalkSpeed;

    cout &lt;&lt; &quot;RunSpeed (am besten 8.00): &quot; ;
	cin  &gt;&gt; RunSpeed;

	cout &lt;&lt; &quot;NPC Rüstung: &quot; ;
	cin  &gt;&gt; Rüstung;

	cout &lt;&lt; &quot;NPC Mana: &quot;;
	cin  &gt;&gt; Mana;

	cout &lt;&lt; &quot;Leben min.: &quot; ;
	cin  &gt;&gt; Lebenmin;

	cout &lt;&lt; &quot;Leben max.: &quot;;
	cin  &gt;&gt; Lebenmax;

	cout &lt;&lt; &quot;Level min.: &quot;;
	cin  &gt;&gt; Levelmin;

	cout &lt;&lt; &quot;Level max.: &quot;;
	cin  &gt;&gt; Levelmin;

	cout &lt;&lt; &quot;Schaden min.: &quot;;
	cin  &gt;&gt; Schadenmin;

	cout &lt;&lt; &quot;Schaden max.: &quot;;
	cin  &gt;&gt; Schadenmax;

	cout &lt;&lt; &quot;res. Heilig: &quot; ;
	cin  &gt;&gt; Heilig;

	cout &lt;&lt; &quot;res. Natur: &quot; ;
	cin  &gt;&gt; Natur;

	cout &lt;&lt; &quot;res. Schatten: &quot; ;
	cin  &gt;&gt; Schatten;

	cout &lt;&lt; &quot;res. Feuer: &quot; ;
	cin  &gt;&gt; Feuer;

	cout &lt;&lt; &quot;res. Frost: &quot; ;
	cin  &gt;&gt; Frost;

    cout &lt;&lt; &quot;res. Arkan: &quot; ;
	cin  &gt;&gt; Arkan;

	cout &lt;&lt; &quot;NPC Optionen (Gossip:1/ Vendor:129/ Armorer:4097/ Gastwirt:65537/ Banker:131073 / Auction:2097153) :  &quot; ;
	cin  &gt;&gt; Optionen;

	cout &lt;&lt; &quot;Gold: &quot;;
	cin  &gt;&gt; Loot;

	system(&quot;PAUSE&quot;);

	return 0;

}
</code></pre>
<p>Hoffe auf schnelle Antwort ....</p>
<p>MfG Andreas</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1908572</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1908572</guid><dc:creator><![CDATA[Forsti]]></dc:creator><pubDate>Mon, 07 Jun 2010 19:58:43 GMT</pubDate></item><item><title><![CDATA[Reply to Brauche hilfe bei meinem ersten Programm? on Mon, 07 Jun 2010 20:22:04 GMT]]></title><description><![CDATA[<p>Hi!</p>
<p>Hab deinen Sourcecode ein bißchen kommentiert. Das ganze müßte jetzt ohne Fehler compilieren. Ich habs auf einem GCC 3.4.5 gebaut.</p>
<p>Ein paar mehr Details wären hilfreich. Z.B. welchen Compiler verwendest du, ...</p>
<p>Das mit dem SQL müßtest du auch noch ein bißchen genauer beschreiben. Ich weiß jetzt nicht, was du damit meinst.</p>
<p>mfg bernd</p>
<pre><code class="language-cpp">//NPC Maker.cpp

#include &lt;iostream&gt;
#include &lt;string&gt;
using namespace std;

int main()
{
    string Name; // Für Zeichenketten strings verwenden
    string Subname; // Für Zeichenketten strings verwenden
    int Rank;
    int Entry;
    int DisplayID;
    int Faction;
    int Groesse; // Keine Umlaute im Sourcecode. Wundert mich, dass dein
                 // Compiler da nicht gemeckert hat.
    float WalkSpeed; // Für Kommazahlen double oder float
    float RunSpeed;
    // int RespawnTimer; Variable wird nicht benutzt.
    int Ruestung; // Umlaut
    int Mana;
    int Lebenmin ;
    int Lebenmax ;
    int Levelmin ;
    // int Levelmax ; Variable wird nicht benutzt.
    int Schadenmin ;
    int Schadenmax ;
    int Heilig;
    int Natur;
    int Schatten;
    int Feuer;
    int Frost;
    int Arkan;
    int Optionen;
    int Loot;

    cout &lt;&lt; &quot; NPC Name: &quot; ;
    cin  &gt;&gt; Name;

    cout &lt;&lt; &quot; NPC Subname: &quot; ;
    cin  &gt;&gt; Subname;

    cout &lt;&lt; &quot; NPC Rang ,schreibe 0 fuer normal, 1 fuer elite, 2 fuer rar elite, 3 fuer world boss, 4 fuer rar, : &quot; ;
    cin  &gt;&gt; Rank;

    cout &lt;&lt; &quot; Entry ID: &quot; ;
    cin  &gt;&gt; Entry;

    cout &lt;&lt; &quot; Display ID: &quot; ;
    cin  &gt;&gt; DisplayID;

    cout &lt;&lt; &quot;NPC Faction ( schreibe 7 für neutral, 14 für feindlich, 35 für Freundlich: &quot; ;
    cin  &gt;&gt; Faction ;

    cout &lt;&lt; &quot;NPC Größe: &quot; ;
    cin  &gt;&gt; Groesse;

    cout &lt;&lt; &quot;WalkSpeed (am besten 2.50): &quot; ;
    cin &gt;&gt; WalkSpeed;

    cout &lt;&lt; &quot;RunSpeed (am besten 8.00): &quot; ;
    cin  &gt;&gt; RunSpeed;

    cout &lt;&lt; &quot;NPC Rüstung: &quot; ;
    cin  &gt;&gt; Ruestung;

    cout &lt;&lt; &quot;NPC Mana: &quot;;
    cin  &gt;&gt; Mana;

    cout &lt;&lt; &quot;Leben min.: &quot; ;
    cin  &gt;&gt; Lebenmin;

    cout &lt;&lt; &quot;Leben max.: &quot;;
    cin  &gt;&gt; Lebenmax;

    cout &lt;&lt; &quot;Level min.: &quot;;
    cin  &gt;&gt; Levelmin;

    cout &lt;&lt; &quot;Level max.: &quot;;
    cin  &gt;&gt; Levelmin;

    cout &lt;&lt; &quot;Schaden min.: &quot;;
    cin  &gt;&gt; Schadenmin;

    cout &lt;&lt; &quot;Schaden max.: &quot;;
    cin  &gt;&gt; Schadenmax;

    cout &lt;&lt; &quot;res. Heilig: &quot; ;
    cin  &gt;&gt; Heilig;

    cout &lt;&lt; &quot;res. Natur: &quot; ;
    cin  &gt;&gt; Natur;

    cout &lt;&lt; &quot;res. Schatten: &quot; ;
    cin  &gt;&gt; Schatten;

    cout &lt;&lt; &quot;res. Feuer: &quot; ;
    cin  &gt;&gt; Feuer;

    cout &lt;&lt; &quot;res. Frost: &quot; ;
    cin  &gt;&gt; Frost;

    cout &lt;&lt; &quot;res. Arkan: &quot; ;
    cin  &gt;&gt; Arkan;

    cout &lt;&lt; &quot;NPC Optionen (Gossip:1/ Vendor:129/ Armorer:4097/ Gastwirt:65537/ Banker:131073 / Auction:2097153) :  &quot; ;
    cin  &gt;&gt; Optionen;

    cout &lt;&lt; &quot;Gold: &quot;;
    cin  &gt;&gt; Loot;

    system(&quot;PAUSE&quot;);

    return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1908590</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1908590</guid><dc:creator><![CDATA[bauerb]]></dc:creator><pubDate>Mon, 07 Jun 2010 20:22:04 GMT</pubDate></item><item><title><![CDATA[Reply to Brauche hilfe bei meinem ersten Programm? on Mon, 07 Jun 2010 20:25:41 GMT]]></title><description><![CDATA[<pre><code>NPC Name: 15
 NPC Subname: 42
 NPC Rang ,schreibe 0 fuer normal, 1 fuer elite, 2 fuer rar elite, 3 fuer world
boss, 4 fuer rar, : 0
 Entry ID: 12
 Display ID: 32
NPC Faction ( schreibe 7 f³r neutral, 14 f³r feindlich, 35 f³r Freundlich: 55
NPC Gr÷▀e: 1565
WalkSpeed (am besten 2.50): 100
RunSpeed (am besten 8.00): -55
NPC R³stung: 11
NPC Mana: 6
Leben min.: 11
Leben max.: 951
Level min.: 11003
Level max.: 631
Schaden min.: 1120
Schaden max.: 56546
res. Heilig: 00
res. Natur: 58
res. Schatten: 210
res. Feuer: 565
res. Frost: 898
res. Arkan: 32183
NPC Optionen (Gossip:1/ Vendor:129/ Armorer:4097/ Gastwirt:65537/ Banker:131073
/ Auction:2097153) :  129
Gold: 1223
Drücken Sie eine beliebige Taste . . .
</code></pre>
<p>Funktioniert doch...</p>
<p>Nein im Ernst, der Fehler ist, dass du Eigenschaften, die Zeichenketten darstellen (z.B. Name) als <code>int</code> deklarierst, weshalb sie lediglich ganze Zahlen als Werte haben können. Wenn du jetzt als Name &quot;Troll&quot; eingibst, ist das offensichtlich keine Zahl, weshalb das Einlesen fehlschläft. Um den weiteren Verlauf zu verstehen, musst du verstehen, wie die Eingabe in C++ funktioniert:<br />
Die eingegebenen Zeichen werden zwischengespeichert. In dem sog. Puffer steht jetzt also &quot;Troll&quot;. Jetzt wird versucht, daraus eine Zahl zu entnehmen. Das schlägt fehl, soweit so gut. Die Zeichen bleiben aber im Puffer. Deswegen wird bei nächsten Aktion ( <code>cin &gt;&gt; Subname;</code> ) der User <em>nicht</em> aufgefordert, eine Eingabe zu tätigen, sondern es wird versucht, die Informationen aus dem Puffer zu exktrahieren. Da aber wieder eine Zahl verlangt wird, schlägt das wieder fehl. So rauscht dein ganzes Programm durch.<br />
Wie du das verhindern kannst, sagt dir am besten Google, die vorerst einfachste Möglichkeit ist, Variablen wie Name und Subname den Typ <code>std::string</code> zu geben, damit sie Zeichenketten aufnehmen können. Dann solltest du aber <code>std::getline</code> verwenden, da sonst die Strings nur bis zum ersten Leerzeichen gelesen werden. Außerdem musst du dich noch darum kümmern, dass <code>cin</code> , sollte doch eine Fehleingabe kommen, zurück gesetzt wird.<br />
Alles im allen gibt es aber dazu einige Online-Tutorials, der Stoff ist leider etwas zu umfangreich, um ihn in einem Beitrag erschöpfend zu erklären.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1908593</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1908593</guid><dc:creator><![CDATA[ipsec]]></dc:creator><pubDate>Mon, 07 Jun 2010 20:25:41 GMT</pubDate></item><item><title><![CDATA[Reply to Brauche hilfe bei meinem ersten Programm? on Mon, 07 Jun 2010 21:21:24 GMT]]></title><description><![CDATA[<p>Erstmal danke für die schnelle Antworten!<br />
Haben mir auch sehr geholfen xD</p>
<p>Okey, ich Programmiere mit Microsoft Visual C++ 2010 Express.<br />
Ich habe jetzt meinen ganzen Code verbessert und er läuft einwandfrei. Nun habe ich aber noch eine kleine Frage:</p>
<p>Wie bekomme ich das was ich da schreibe wie z.B &quot;Name: Chaos&quot; in eine SQL- Datein hineingeschrieben. So als ob ichs in ein Text Dokument speichere, nur das es hald kein .txt sondern .sql ist.<br />
Und wie mache ich es das wenn ich &quot;Name: Chaos schreibe es dann so im Dokument steht: &quot;insert into `creature_template` (`Chaos`) &quot; nur mal so als Beispiel.</p>
<p>MfG Andreas</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1908624</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1908624</guid><dc:creator><![CDATA[Forsti]]></dc:creator><pubDate>Mon, 07 Jun 2010 21:21:24 GMT</pubDate></item><item><title><![CDATA[Reply to Brauche hilfe bei meinem ersten Programm? on Mon, 07 Jun 2010 21:43:26 GMT]]></title><description><![CDATA[<p>Forsti schrieb:</p>
<blockquote>
<p>Wie bekomme ich das was ich da schreibe wie z.B &quot;Name: Chaos&quot; in eine SQL- Datein hineingeschrieben. So als ob ichs in ein Text Dokument speichere, nur das es hald kein .txt sondern .sql ist.</p>
</blockquote>
<p>Die Dateiendung ist ganz egal. Du schreibst deswegen auch nur in eine Textdatei.</p>
<pre><code class="language-cpp">int main()
{
  ofstream testfile;
  testfile.open(&quot;test.sql&quot;);
  testfile&lt;&lt; &quot;Bla bla blub....&quot;;
  testfile.close();
  return 0;
}
</code></pre>
<p>Forsti schrieb:</p>
<blockquote>
<p>Und wie mache ich es das wenn ich &quot;Name: Chaos schreibe es dann so im Dokument steht: &quot;insert into `creature_template` (`Chaos`) &quot; nur mal so als Beispiel.</p>
</blockquote>
<p>Einfach einen String zusammenbasteln.</p>
<pre><code class="language-cpp">string test(string vorname, string nachname)
{
  string s;

  s.append(&quot;insert into tbl_bla (vorname, nachname) VALUES(&quot;);
  s.append(vorname);
  s.append(&quot;, &quot;);
  s.append(nachname);
  s.append(&quot;);&quot;);

  return s;
}
</code></pre>
<p>Schau dir mal <a href="http://www.cppreference.com/wiki/" rel="nofollow">http://www.cppreference.com/wiki/</a> an.</p>
<p>mfg bernd</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1908639</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1908639</guid><dc:creator><![CDATA[bauerb]]></dc:creator><pubDate>Mon, 07 Jun 2010 21:43:26 GMT</pubDate></item><item><title><![CDATA[Reply to Brauche hilfe bei meinem ersten Programm? on Tue, 08 Jun 2010 13:07:54 GMT]]></title><description><![CDATA[<p>Danke!</p>
<p>Aber wo schreibe ich das jetzt hier rein? xDD kenn das mit dem speichern in eine andere datei noch nicht <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">//NPC Maker.cpp 

#include &lt;stdafx.h&gt;
#include &lt;iostream&gt; 
#include &lt;string&gt; 
using namespace std; 

int main() 
{ 

    string Name; 
    string Subname;  
    string Rank; 
    float Entry; 
    float DisplayID; 
    string Faction; 
    float Groesse; 
    float Ruestung;
    float Mana; 
    float Lebenmin ; 
    float Lebenmax ; 
    float Levelmin ; 
    float Schadenmin ; 
    float Schadenmax ; 
    float Heilig; 
    float Natur; 
    float Schatten; 
    float Feuer; 
    float Frost; 
    float Arkan; 
    float Optionen; 
    float Loot; 

///////////////////////////////////////////////

    cout &lt;&lt; &quot; NPC Name: &quot; ; 
    cin  &gt;&gt; Name;

    cout &lt;&lt; &quot; NPC Subname: &quot; ; 
    cin  &gt;&gt; Subname; 

    cout &lt;&lt; &quot; NPC Rang ,schreibe 0 fuer normal, 1 fuer elite, 2 fuer rar elite, 3 fuer world boss, 4 fuer rar, : &quot; ; 
    cin  &gt;&gt; Rank; 

    cout &lt;&lt; &quot; Entry ID: &quot; ; 
    cin  &gt;&gt; Entry; 

    cout &lt;&lt; &quot; Display ID: &quot; ; 
    cin  &gt;&gt; DisplayID; 

    cout &lt;&lt; &quot;NPC Faction ( schreibe 7 fuer neutral, 14 fuer feindlich, 35 fuer Freundlich: &quot; ; 
    cin  &gt;&gt; Faction ; 

    cout &lt;&lt; &quot;NPC Größe: &quot; ; 
    cin  &gt;&gt; Groesse; 

    cout &lt;&lt; &quot;WalkSpeed (am besten 2.50): &quot; ; 
    cin &gt;&gt; WalkSpeed; 

    cout &lt;&lt; &quot;RunSpeed (am besten 8.00): &quot; ; 
    cin  &gt;&gt; RunSpeed; 

    cout &lt;&lt; &quot;NPC Rüstung: &quot; ; 
    cin  &gt;&gt; Ruestung; 

    cout &lt;&lt; &quot;NPC Mana: &quot;; 
    cin  &gt;&gt; Mana; 

    cout &lt;&lt; &quot;Leben min.: &quot; ; 
    cin  &gt;&gt; Lebenmin; 

    cout &lt;&lt; &quot;Leben max.: &quot;; 
    cin  &gt;&gt; Lebenmax; 

    cout &lt;&lt; &quot;Level min.: &quot;; 
    cin  &gt;&gt; Levelmin; 

    cout &lt;&lt; &quot;Level max.: &quot;; 
    cin  &gt;&gt; Levelmin; 

    cout &lt;&lt; &quot;Schaden min.: &quot;; 
    cin  &gt;&gt; Schadenmin; 

    cout &lt;&lt; &quot;Schaden max.: &quot;; 
    cin  &gt;&gt; Schadenmax; 

    cout &lt;&lt; &quot;res. Heilig: &quot; ; 
    cin  &gt;&gt; Heilig; 

    cout &lt;&lt; &quot;res. Natur: &quot; ; 
    cin  &gt;&gt; Natur; 

    cout &lt;&lt; &quot;res. Schatten: &quot; ; 
    cin  &gt;&gt; Schatten; 

    cout &lt;&lt; &quot;res. Feuer: &quot; ; 
    cin  &gt;&gt; Feuer; 

    cout &lt;&lt; &quot;res. Frost: &quot; ; 
    cin  &gt;&gt; Frost; 

    cout &lt;&lt; &quot;res. Arkan: &quot; ; 
    cin  &gt;&gt; Arkan; 

    cout &lt;&lt; &quot;NPC Optionen (Gossip:1/ Vendor:129/ Armorer:4097/ Gastwirt:65537/ Banker:131073 / Auction:2097153) :  &quot; ; 
    cin  &gt;&gt; Optionen; 

    cout &lt;&lt; &quot;Gold: &quot;; 
    cin  &gt;&gt; Loot; 

    system(&quot;PAUSE&quot;); 

    return 0; 
}
</code></pre>
<p>MfG Forsti</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1908883</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1908883</guid><dc:creator><![CDATA[Forsti]]></dc:creator><pubDate>Tue, 08 Jun 2010 13:07:54 GMT</pubDate></item><item><title><![CDATA[Reply to Brauche hilfe bei meinem ersten Programm? on Tue, 08 Jun 2010 13:17:14 GMT]]></title><description><![CDATA[<p>Hi!</p>
<p>Mach erst mal ein Tutorial zu C++ durch oder kauf dir ein Buch.</p>
<p>mfg Bernd</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1908888</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1908888</guid><dc:creator><![CDATA[bauerb]]></dc:creator><pubDate>Tue, 08 Jun 2010 13:17:14 GMT</pubDate></item><item><title><![CDATA[Reply to Brauche hilfe bei meinem ersten Programm? on Tue, 08 Jun 2010 13:21:24 GMT]]></title><description><![CDATA[<p>Und aus Lust an der Freude das Thema SQL-Injections anschauen. <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/1908891</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1908891</guid><dc:creator><![CDATA[Fellhuhn]]></dc:creator><pubDate>Tue, 08 Jun 2010 13:21:24 GMT</pubDate></item><item><title><![CDATA[Reply to Brauche hilfe bei meinem ersten Programm? on Tue, 08 Jun 2010 13:22:08 GMT]]></title><description><![CDATA[<p><a href="http://www.cplusplus.com/reference/iostream/ofstream/ofstream/" rel="nofollow">http://www.cplusplus.com/reference/iostream/ofstream/ofstream/</a></p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;fstream&gt;
using namespace std;

int main () 
{
int mana = 100;
int health = 40;

  ofstream outfile (&quot;test.txt&quot;);

   outfile &lt;&lt; health&lt;&lt;endl; // schreib den wert 40 mit einem zeilenumbruch in die datei test.txt
  outfile &lt;&lt; mana;  // schreibe den wert 100 in die datei test.txt

  outfile.close();

  return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1908893</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1908893</guid><dc:creator><![CDATA[_sup]]></dc:creator><pubDate>Tue, 08 Jun 2010 13:22:08 GMT</pubDate></item><item><title><![CDATA[Reply to Brauche hilfe bei meinem ersten Programm? on Tue, 08 Jun 2010 13:23:09 GMT]]></title><description><![CDATA[<p>Ein C++ Tutorial:</p>
<p><a href="http://www.cpp-tutor.de/cpp/hinweise.html" rel="nofollow">http://www.cpp-tutor.de/cpp/hinweise.html</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1908895</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1908895</guid><dc:creator><![CDATA[_sup]]></dc:creator><pubDate>Tue, 08 Jun 2010 13:23:09 GMT</pubDate></item></channel></rss>