<?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[Funktion &amp;quot;Load()&amp;quot; liefert nur NULL aus binaerer datei zurueck]]></title><description><![CDATA[<p>huhu, folgendes diese datei liefert nur eine null zurueck, was is an der funktion falsch?</p>
<pre><code class="language-cpp">void Load()
 {
    char c[] = &quot;C:\\&quot;;
    string name;
    cout &lt;&lt; &quot; Welche Datei soll vom Datentraeger \&quot;C\&quot; geladen werden?\n&quot;
         &lt;&lt; &quot; Geben Sie den exakten Namen der Date an!\n&quot;;
    cout &lt;&lt; &quot; C:\\&quot;;
    cin  &gt;&gt; name;
    string load = c + name;
    ifstream file(load.c_str());
    do
    {
        load += static_cast&lt;char &gt;(file.get());
    }
    while(!file.fail());

        file.close();
        cout &lt;&lt; &quot;\n\n &quot; &lt;&lt; file &lt;&lt; endl;
 }
</code></pre>
<p>:schland: 1 : 0 gegen Ita * fg * <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/topic/152265/funktion-quot-load-quot-liefert-nur-null-aus-binaerer-datei-zurueck</link><generator>RSS for Node</generator><lastBuildDate>Sun, 06 Sep 2026 21:48:18 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/152265.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 04 Jul 2006 17:54:46 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Funktion &amp;quot;Load()&amp;quot; liefert nur NULL aus binaerer datei zurueck on Tue, 04 Jul 2006 17:54:46 GMT]]></title><description><![CDATA[<p>huhu, folgendes diese datei liefert nur eine null zurueck, was is an der funktion falsch?</p>
<pre><code class="language-cpp">void Load()
 {
    char c[] = &quot;C:\\&quot;;
    string name;
    cout &lt;&lt; &quot; Welche Datei soll vom Datentraeger \&quot;C\&quot; geladen werden?\n&quot;
         &lt;&lt; &quot; Geben Sie den exakten Namen der Date an!\n&quot;;
    cout &lt;&lt; &quot; C:\\&quot;;
    cin  &gt;&gt; name;
    string load = c + name;
    ifstream file(load.c_str());
    do
    {
        load += static_cast&lt;char &gt;(file.get());
    }
    while(!file.fail());

        file.close();
        cout &lt;&lt; &quot;\n\n &quot; &lt;&lt; file &lt;&lt; endl;
 }
</code></pre>
<p>:schland: 1 : 0 gegen Ita * fg * <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/1091377</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1091377</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Tue, 04 Jul 2006 17:54:46 GMT</pubDate></item><item><title><![CDATA[Reply to Funktion &amp;quot;Load()&amp;quot; liefert nur NULL aus binaerer datei zurueck on Tue, 04 Jul 2006 18:16:31 GMT]]></title><description><![CDATA[<p>Was funktioniert denn nicht? Eine Stream-Variable auszugeben funktioniert afaik nicht. Wahrscheinlich willst du load ausgeben, statt file.</p>
<p>Btw: :schland: 2:1 Ita <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/1091391</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1091391</guid><dc:creator><![CDATA[Vellas]]></dc:creator><pubDate>Tue, 04 Jul 2006 18:16:31 GMT</pubDate></item><item><title><![CDATA[Reply to Funktion &amp;quot;Load()&amp;quot; liefert nur NULL aus binaerer datei zurueck on Tue, 04 Jul 2006 18:20:47 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Das sehe ich auch so :).</p>
<p>Nebenbei: suchst du nicht EOF und nicht FAIL?</p>
<p>MFG winexec*</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1091394</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1091394</guid><dc:creator><![CDATA[winexec*]]></dc:creator><pubDate>Tue, 04 Jul 2006 18:20:47 GMT</pubDate></item><item><title><![CDATA[Reply to Funktion &amp;quot;Load()&amp;quot; liefert nur NULL aus binaerer datei zurueck on Tue, 04 Jul 2006 18:56:34 GMT]]></title><description><![CDATA[<p>oO.... keine Ahnung hat...<br />
hier der ganze code soll man zwar net machen aba oO:</p>
<pre><code class="language-cpp">//--- Part. Including ----------------------------------------------------------

 #include &lt;iostream&gt;
 #include &lt;vector&gt;
 #include &lt;string&gt;
 #include &lt;fstream&gt;
     using namespace std;
//==============================================================================

    class person
    {
    public:
        void SetAngaben(string pname,string pnickname,string paddress,string ptelnr,string page);
        void ShowAll();
        void Save();
        void Load();
        person();
        ~person();
    private:
        string name, nickname, address, telnr, age;
    };

    void person::SetAngaben(string pname,string pnickname,string padress, string ptelnr,string page)
    {

        this-&gt;name = pname;
        this-&gt;nickname = pnickname;
        this-&gt;address = padress;
        this-&gt;telnr = ptelnr;
        this-&gt;age = page;
    }

    void person::ShowAll()
    {
        cout &lt;&lt; &quot; Ihre Angaben waren wie folgt:\n\n&quot;
             &lt;&lt; &quot; Name    : &quot; &lt;&lt; name &lt;&lt; &quot;\n&quot;
             &lt;&lt; &quot; Nickname: &quot; &lt;&lt; nickname &lt;&lt; &quot;\n&quot;
             &lt;&lt; &quot; Alter   : &quot; &lt;&lt; age &lt;&lt; &quot;\n&quot;
             &lt;&lt; &quot; Adresse : &quot; &lt;&lt; address &lt;&lt; &quot;\n&quot;
             &lt;&lt; &quot; Telefon : &quot; &lt;&lt; telnr &lt;&lt; &quot;\n\n&quot;;
           //  cin.get();
    }

    person::person()
    {
    }

    person::~person()
    {
    }

//--- Part. Save &amp; Load Funktion -----------------------------------------------

 void person::Save()
 {

  while(true)
       {
      char c[] = &quot;C:\\&quot;;
      string name;
       cout &lt;&lt; &quot;\n\n\n&quot;;
       cout &lt;&lt; &quot; Gib einen Namen an unter den, die Datei gespeichert werden soll:\n&quot;
            &lt;&lt; &quot; C:\\&quot;;
       cin  &gt;&gt;  name;
       string save = c + name;

       ofstream file(save.c_str(),ios::app);
            file &lt;&lt; name &lt;&lt; &quot;/&quot; &lt;&lt; nickname &lt;&lt; &quot;/&quot; &lt;&lt; age &lt;&lt; &quot;/&quot; &lt;&lt; address &lt;&lt; &quot;/&quot; &lt;&lt; telnr;
            file.close();

         if(file.good())
         {

            cout &lt;&lt; &quot;\n Datei wurde erfolgreich unter \&quot;&quot;&lt;&lt; save &lt;&lt; &quot;\&quot; gespeichert!\n&quot;;
            cin.get();
            break;
         }

         else
         {
            cout &lt;&lt; &quot;\n Die Datei \&quot;&quot; &lt;&lt; save &lt;&lt; &quot;\&quot; konnte nicht gespeichert werden!\n &quot; &lt;&lt; endl;
            cin.clear();
            cin.sync();
            continue;
         }
       }
 }

 void Load()
 {
    char c[] = &quot;C:\\&quot;;
    string name;
    cout &lt;&lt; &quot; Welche Datei soll vom Datentraeger \&quot;C\&quot; geladen werden?\n&quot;
         &lt;&lt; &quot; Geben Sie den exakten Namen der Date an!\n&quot;;
    cout &lt;&lt; &quot; C:\\&quot;;
    cin  &gt;&gt; name;
    string load = c + name;
    ifstream file(load.c_str());
    do
    {
        load += static_cast&lt;char &gt;(file.get());
    }
    while(!file.fail());

        file.close();
        cout &lt;&lt; &quot;\n\n &quot; &lt;&lt; file &lt;&lt; endl;
 }

main()
{
    string in_name, in_nickname, in_address, in_telnr, in_age;

    cout &lt;&lt; &quot; Bitte geben Sie hier die folgenden Daten an!\n&quot;;
    cout &lt;&lt; &quot; (Eingabe mit ENTER bestaetigen!)\n\n&quot;;
    cout &lt;&lt; &quot; Ihren vollstaendigen Namen         : &quot;; getline(cin, in_name);
    cout &lt;&lt; &quot; Wie lautet ihr Spitzname?          : &quot;; getline(cin, in_nickname);
    cout &lt;&lt; &quot; Wie alt sind Sie?                  : &quot;; getline(cin, in_age);
    cout &lt;&lt; &quot; Geben Sie bitte ihre Anschrift an! : &quot;; getline(cin, in_address);
    cout &lt;&lt; &quot; Wie lautet ihre Telefonnummer?     : &quot;; getline(cin, in_telnr);
    cout &lt;&lt; &quot;\n\n\n&quot;;

    person pers;
    pers.SetAngaben(in_name,in_nickname,in_address,in_telnr,in_age);
    pers.ShowAll();
    pers.Save();

 bool quest = true;

 while(quest)
 {

  cout &lt;&lt; &quot;\n\n\n&quot;;
  cout &lt;&lt; &quot;\n Wollen Sie jetzt die Eintraege in einer Datei einsehen?\n&quot;
       &lt;&lt; &quot; #1 - JA!  /  #2 - NEIN! \n&quot;
       &lt;&lt; &quot; &gt;&gt; &quot;;

  int vote1;
  cin  &gt;&gt; vote1;

    if(cin.good())
    {
        switch (vote1)
        {
            case 1:
                Load();
                break;

            case 2:
                return 0;

            default:

                cout &lt;&lt; &quot;\n Bitte nutzen Sie die Ziffern 1 und 2 um fortzufahren!\n&quot;;
                cin.clear();
                cin.sync();
                continue;
        }
    }
    else
    {
          cout &lt;&lt; &quot;\n Bitte nutzen Sie die Ziffern 1 und 2 um fortzufahren!\n&quot;;
          cin.clear();
          cin.sync();
          continue;
    }
 }

}
</code></pre>
<p>immer wenn ichs dann laden will und aus der datei lesen moechte gehts net</p>
<p>gehts nun :schland: siegen sehen <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/1091405</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1091405</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Tue, 04 Jul 2006 18:56:34 GMT</pubDate></item><item><title><![CDATA[Reply to Funktion &amp;quot;Load()&amp;quot; liefert nur NULL aus binaerer datei zurueck on Tue, 04 Jul 2006 21:44:51 GMT]]></title><description><![CDATA[<p>Wie gesagt, du willst in der Funktion Load in der Zeile</p>
<pre><code class="language-cpp">cout &lt;&lt; &quot;\n\n &quot; &lt;&lt; file &lt;&lt; endl;
</code></pre>
<p>wohl nicht file, sondern load ausgeben lassen. In load lädst du immerhin den Inhalt der Datei und file ist der Stream zur Datei.</p>
<p>Da braucht man den gesamten Code nicht.<br />
Und wieso hast du keine Ahnung? Wir haben dir doch gesagt was falsch ist.</p>
<p>Tja...das wars dann mit der WM für :schland:</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1091462</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1091462</guid><dc:creator><![CDATA[Vellas]]></dc:creator><pubDate>Tue, 04 Jul 2006 21:44:51 GMT</pubDate></item><item><title><![CDATA[Reply to Funktion &amp;quot;Load()&amp;quot; liefert nur NULL aus binaerer datei zurueck on Wed, 05 Jul 2006 05:13:17 GMT]]></title><description><![CDATA[<p>soorry war gestern so voller nervosität und wollte nur noch zum fernsehr... naja deutschlandd ist dann wohl net der neue wm-meistern *schnief*... so danke erst mal ich geh jetzt erst mal zur schule oO</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1091506</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1091506</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Wed, 05 Jul 2006 05:13:17 GMT</pubDate></item><item><title><![CDATA[Reply to Funktion &amp;quot;Load()&amp;quot; liefert nur NULL aus binaerer datei zurueck on Wed, 05 Jul 2006 07:13:27 GMT]]></title><description><![CDATA[<p>T0bi schrieb:</p>
<blockquote>
<p>wm-meistern</p>
</blockquote>
<p>Weltmeisterschaftsmeister?!</p>
<p>*SCNR*</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1091536</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1091536</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Wed, 05 Jul 2006 07:13:27 GMT</pubDate></item><item><title><![CDATA[Reply to Funktion &amp;quot;Load()&amp;quot; liefert nur NULL aus binaerer datei zurueck on Wed, 05 Jul 2006 07:35:41 GMT]]></title><description><![CDATA[<p>LordJaxom schrieb:</p>
<blockquote>
<p>T0bi schrieb:</p>
<blockquote>
<p>wm-meistern</p>
</blockquote>
<p>Weltmeisterschaftsmeister?!</p>
<p>*SCNR*</p>
</blockquote>
<p>erwarte nicht zuviel von fußball-fans <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>btw. main() gibt int zurück</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1091551</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1091551</guid><dc:creator><![CDATA[cin]]></dc:creator><pubDate>Wed, 05 Jul 2006 07:35:41 GMT</pubDate></item><item><title><![CDATA[Reply to Funktion &amp;quot;Load()&amp;quot; liefert nur NULL aus binaerer datei zurueck on Wed, 05 Jul 2006 13:05:18 GMT]]></title><description><![CDATA[<p>LordJaxom schrieb:</p>
<blockquote>
<p>T0bi schrieb:</p>
<blockquote>
<p>wm-meistern</p>
</blockquote>
<p>Weltmeisterschaftsmeister?!</p>
<p>*SCNR*</p>
</blockquote>
<p>ja wm meister... .die meister von der fussballmeisterschaft..... <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>
<p>aber zurück zum eigentlichen thema:</p>
<p>ich bin mit der sache wegen der funktion „load()“ immer noch kein stück weiter, ich habe zwar „ cout &lt;&lt; „\n\n“ &lt;&lt; load &lt;&lt;endl;“ nun so geaendert aber jetzt gibt er denk ich nur die speicheradresse aus (4205848), muss ich das nun mit einer referenz lösen??? Ich weiss es leider nicht.</p>
<p>Ach ja noch etwas, ich frage mich:<br />
Wenn ich eine ofstream file(„bin.dat“,ios.binary|ios::app) habe und hier die strings( name, alter …) ablege[file &lt;&lt; „\n“ &lt;&lt; name &lt;&lt; „/“ &lt;&lt; alter &lt;&lt; „/“ ….] und dann das prog noch mal laufen lasse und wieder elemente speichern werde sind die ja auch wieder vom selben string, und die werden auh wieder in die datei geschrieben, werden diese hinten an die datei geschrieben. Also muesste ja dann alles so aus sehen:</p>
<p>Datei: test.dat</p>
<p>Name/alter/…… // personangaben für knut<br />
Name/alter/…… // personangaben für keule<br />
… // und weitere angaben von anderen</p>
<p>nun geb ich in meiner load funktion (die ja noch nicht wirklich funktioniert) den namen der datei an also test.dat . und will nun die daten von keule auslesen lassen und nicht die anderen.<br />
Wie stell ich das an???</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1091785</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1091785</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Wed, 05 Jul 2006 13:05:18 GMT</pubDate></item><item><title><![CDATA[Reply to Funktion &amp;quot;Load()&amp;quot; liefert nur NULL aus binaerer datei zurueck on Wed, 05 Jul 2006 15:12:34 GMT]]></title><description><![CDATA[<p>please answer <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="😃"
    /><br />
thanX!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1091916</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1091916</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Wed, 05 Jul 2006 15:12:34 GMT</pubDate></item><item><title><![CDATA[Reply to Funktion &amp;quot;Load()&amp;quot; liefert nur NULL aus binaerer datei zurueck on Wed, 05 Jul 2006 16:22:21 GMT]]></title><description><![CDATA[<p>Lies doch erstmal alle ein (z.Bsp. in ein Array) und suche dir dann die Daten für Keule raus. Oder weißt du der wievielte Datensatz das ist, den du suchst?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1091996</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1091996</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Wed, 05 Jul 2006 16:22:21 GMT</pubDate></item><item><title><![CDATA[Reply to Funktion &amp;quot;Load()&amp;quot; liefert nur NULL aus binaerer datei zurueck on Wed, 05 Jul 2006 17:11:41 GMT]]></title><description><![CDATA[<p>Also nach binär sieht mir das nicht aus:</p>
<pre><code class="language-cpp">ifstream file(load.c_str());
</code></pre>
<p>Und warum willst du denn den inhalt einer binär datei mit cout ausgeben der text ist doch (wenns wirklich ne binär datei ist) nicht formatiert <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>
<p>Und dein Stil:</p>
<pre><code class="language-cpp">person::person() 
    { 
    } 
person::~person() 
    { 
    }
</code></pre>
<p>Bei Funktionen muss immer ein Rückgabewert angegeben werden, und wenns nur void ist :).<br />
(Außerdem, was willst mit ner funktion die nen leeren rumpf hat^^</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1092023</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1092023</guid><dc:creator><![CDATA[tobZel]]></dc:creator><pubDate>Wed, 05 Jul 2006 17:11:41 GMT</pubDate></item><item><title><![CDATA[Reply to Funktion &amp;quot;Load()&amp;quot; liefert nur NULL aus binaerer datei zurueck on Wed, 05 Jul 2006 17:15:25 GMT]]></title><description><![CDATA[<p>So ich hab mir deinen Code nochmal angeguckt du willst also ne Instanz von ner Klasse in ne datei schreiben.<br />
Das würde ich mit write() und read() machen da kannst auch angeben wie viele bytes gelesen werden sollen, da nimmst dann einfach:</p>
<pre><code class="language-cpp">sizeof(person)
</code></pre>
<p>Und nicht den modus ios::binary vergessen!! <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/1092032</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1092032</guid><dc:creator><![CDATA[tobZel]]></dc:creator><pubDate>Wed, 05 Jul 2006 17:15:25 GMT</pubDate></item><item><title><![CDATA[Reply to Funktion &amp;quot;Load()&amp;quot; liefert nur NULL aus binaerer datei zurueck on Wed, 05 Jul 2006 17:51:27 GMT]]></title><description><![CDATA[<p>das heisst also, das ich ja die maximalen byts festlegen muss richtig? also char name[30] .... geht sowas mit write nicht auch mit strings?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1092062</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1092062</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Wed, 05 Jul 2006 17:51:27 GMT</pubDate></item><item><title><![CDATA[Reply to Funktion &amp;quot;Load()&amp;quot; liefert nur NULL aus binaerer datei zurueck on Thu, 06 Jul 2006 12:12:44 GMT]]></title><description><![CDATA[<p>Nein!!<br />
Du musst write sagen wie groß deine Klasse ist.<br />
Und ausserdem kannst du keine Variablen vom type string binär speichern, da du dann nur eine addresse in die Datei schreibst.</p>
<p>Entweder du änderst dein Konzept auf textbasiert nicht binär.<br />
Oder du machst ne max lenght für name und so.</p>
<p>Bsp.</p>
<pre><code class="language-cpp">class person 
{ 
    public: 
  //methoden
    private:
        char[20] name;
        char[20] nickname;
        char[40] address;
        char[20] telnr;
        char[2] age;
};

int main()
{
     person Test;
     ofstream Datei;
     Datei.wirte((char *) &amp;Test, sizeof(Test));
     return 0;
}
</code></pre>
<p>Zwar bisschen abgemagert sollte es dir aber zeigen</p>
<p>mfg tobZel</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1092065</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1092065</guid><dc:creator><![CDATA[tobZel]]></dc:creator><pubDate>Thu, 06 Jul 2006 12:12:44 GMT</pubDate></item><item><title><![CDATA[Reply to Funktion &amp;quot;Load()&amp;quot; liefert nur NULL aus binaerer datei zurueck on Wed, 05 Jul 2006 18:19:54 GMT]]></title><description><![CDATA[<p>grrrmmmmmmmmmlllll... ist echt zum .... hier... egal wie ichs drehe es funktioniert einfach nicht.... <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="😞"
    /> auf jeden fall gings so nicht... so hab ich nur 30fehler bekommen....</p>
<p>ich habs nun als txt datei gemacht.... aber ich kann den string trotzdem net aus lesen lassen.... da erscheint dann einfach mal gar nix</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1092074</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1092074</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Wed, 05 Jul 2006 18:19:54 GMT</pubDate></item><item><title><![CDATA[Reply to Funktion &amp;quot;Load()&amp;quot; liefert nur NULL aus binaerer datei zurueck on Thu, 06 Jul 2006 09:05:03 GMT]]></title><description><![CDATA[<p>Mein lieber tobZel. Das was du da geschrieben hast ist ziemlicher Quatsch.<br />
<a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/12675">@T0bi</a><br />
Mach es als Text. Das ist für dich erstmal einfacher.<br />
Wenn deine Strings keine Leerzeichen enthalten. Schreibe sie einfach mit einen Leerzeichen getrennt raus.</p>
<pre><code class="language-cpp">string test11(&quot;Paul&quot;);
string test12 (&quot;Mueller&quot;);
string test21 (&quot;Frank&quot;);
string test22 (&quot;Schmidt&quot;);
ofstream out(&quot;Test.txt&quot;);
out &lt;&lt; test11 &lt;&lt; &quot; &quot; &lt;&lt; test12 &lt;&lt; &quot;\n&quot;;
out &lt;&lt; test21 &lt;&lt; &quot; &quot; &lt;&lt; test22 &lt;&lt; &quot;\n&quot;;
out.close();
// dann einlesen
ifstream ein(&quot;Test.txt&quot;);
string str1, str2;
while( ein &gt;&gt; str1 &gt;&gt; str2 )
{
// mach irgendwas mit den strings   
}
</code></pre>
<p>Wenn Leerzeichen enthlaten sein können schreib jeden String in eine eigene Zeile und lies dann mit getline wieder ein.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1092281</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1092281</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Thu, 06 Jul 2006 09:05:03 GMT</pubDate></item></channel></rss>