<?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[Problem mit vector]]></title><description><![CDATA[<p>Hi</p>
<p>hab schon wieder ein Problem diesmal mit Vectoren. Während der Runtime tritt ein Fehler auf.</p>
<pre><code class="language-cpp">//---------------------------------------------------------------------------

//eigene Klassen und Funktionen
#include&quot;user.h&quot;
#include&quot;menu.h&quot;
#include&quot;funk.h&quot;
#include&quot;settings.h&quot;
//---------------------------------------------------------------------------

int main()
{
   //Datenströme
   ofstream out(&quot;pwd.pw&quot;,ios::app);
   ifstream in(&quot;pwd.pw&quot;);

   //Variablen
   admin administrator(&quot;admin&quot;,&quot;bsb&quot;,&quot;n/a&quot;,&quot;admin&quot;);  //standart administrator
   vector&lt;user&gt; aa;   //user array
   vector&lt;user&gt;::iterator paa;
   vector&lt;admin&gt; bb;  //admin array
   vector&lt;admin&gt;::iterator pbb;
   int iUserzahl=0;
   int iAdmins=0;
   int iUser=0;
   string strInput[2];//Eingabe Puffer 0=Benutzername 1=Passwort
   string strPuffer[5];//Einlese Puffer
   char x[3];  //Noch ein einlese Puffer
   bool bUserchk=false;
   bool bAdminchk=false;

   //Zahl der Datensätze aus Datei lesen
   in&gt;&gt;x;
   iUserzahl=atoi(x);

   for(int i=0;i&lt;iUserzahl;i++)   //Einlese Schleife
        {
        in&gt;&gt;strPuffer[0];   //Name
        in&gt;&gt;strPuffer[1];   //Passwort
        in&gt;&gt;strPuffer[2];   //Vorname
        in&gt;&gt;strPuffer[3];   //Benutzername
        in&gt;&gt;strPuffer[4];   //Status

        if(strPuffer[4]==&quot;user&quot;)//user in array schreiben
                {
                user Puffer(strPuffer[0],strPuffer[1],strPuffer[2],strPuffer[3]);
                aa.push_back(Puffer);
                iUser++;
                }
        if(strPuffer[4]==&quot;admin&quot;)//admin in array schreiben
                {
                admin Puffer(strPuffer[0],strPuffer[1],strPuffer[2],strPuffer[3]);
                bb.push_back(Puffer);
                iAdmins++;
                }
        }

   while(1)
   {
   start(strInput);
   strInput[1]=pw(strInput[1]);

   for(int i=0;i&lt;iUser;i++)  //User Prüfung
        {
        if(aa[i].getBenutzername()==strInput[0])
                {
                if(aa[i].getPasswort()==strInput[1])
                        {
                        bUserchk=true;
                        }
                }
        }

   for(int i=0;i&lt;iAdmins;i++) //Admin Prüfung
        {
        if(bb[i].getBenutzername()==strInput[0])
                {
                if(bb[i].getPasswort()==strInput[1])
                        {
                        bAdminchk=true;
                        }
                }
        }
   if(strInput[0]==&quot;admin&quot;&amp;&amp;&quot;bsb&quot;==pw(strInput[1])) //std Admin Prüfung
        {
        bAdminchk=true;
        }
   if(bUserchk)
        break;
   if(bAdminchk)
        break;
   clrscr();
   cout&lt;&lt;&quot;Falscher Benutzername oder Passwort&quot;;
   }

   getchar();
   getchar();
   return 0;
}
//---------------------------------------------------------------------------
</code></pre>
<p>bevor ich den Teil in der while(1) Schleife geschrieben habe gings.<br />
Ich nutze üprigens den Borland C++ Builder 6.</p>
<p>soll ich die Headerdatein noch posten ??</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/138997/problem-mit-vector</link><generator>RSS for Node</generator><lastBuildDate>Sun, 30 Aug 2026 08:30:50 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/138997.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 02 Mar 2006 21:10:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problem mit vector on Thu, 02 Mar 2006 21:10:28 GMT]]></title><description><![CDATA[<p>Hi</p>
<p>hab schon wieder ein Problem diesmal mit Vectoren. Während der Runtime tritt ein Fehler auf.</p>
<pre><code class="language-cpp">//---------------------------------------------------------------------------

//eigene Klassen und Funktionen
#include&quot;user.h&quot;
#include&quot;menu.h&quot;
#include&quot;funk.h&quot;
#include&quot;settings.h&quot;
//---------------------------------------------------------------------------

int main()
{
   //Datenströme
   ofstream out(&quot;pwd.pw&quot;,ios::app);
   ifstream in(&quot;pwd.pw&quot;);

   //Variablen
   admin administrator(&quot;admin&quot;,&quot;bsb&quot;,&quot;n/a&quot;,&quot;admin&quot;);  //standart administrator
   vector&lt;user&gt; aa;   //user array
   vector&lt;user&gt;::iterator paa;
   vector&lt;admin&gt; bb;  //admin array
   vector&lt;admin&gt;::iterator pbb;
   int iUserzahl=0;
   int iAdmins=0;
   int iUser=0;
   string strInput[2];//Eingabe Puffer 0=Benutzername 1=Passwort
   string strPuffer[5];//Einlese Puffer
   char x[3];  //Noch ein einlese Puffer
   bool bUserchk=false;
   bool bAdminchk=false;

   //Zahl der Datensätze aus Datei lesen
   in&gt;&gt;x;
   iUserzahl=atoi(x);

   for(int i=0;i&lt;iUserzahl;i++)   //Einlese Schleife
        {
        in&gt;&gt;strPuffer[0];   //Name
        in&gt;&gt;strPuffer[1];   //Passwort
        in&gt;&gt;strPuffer[2];   //Vorname
        in&gt;&gt;strPuffer[3];   //Benutzername
        in&gt;&gt;strPuffer[4];   //Status

        if(strPuffer[4]==&quot;user&quot;)//user in array schreiben
                {
                user Puffer(strPuffer[0],strPuffer[1],strPuffer[2],strPuffer[3]);
                aa.push_back(Puffer);
                iUser++;
                }
        if(strPuffer[4]==&quot;admin&quot;)//admin in array schreiben
                {
                admin Puffer(strPuffer[0],strPuffer[1],strPuffer[2],strPuffer[3]);
                bb.push_back(Puffer);
                iAdmins++;
                }
        }

   while(1)
   {
   start(strInput);
   strInput[1]=pw(strInput[1]);

   for(int i=0;i&lt;iUser;i++)  //User Prüfung
        {
        if(aa[i].getBenutzername()==strInput[0])
                {
                if(aa[i].getPasswort()==strInput[1])
                        {
                        bUserchk=true;
                        }
                }
        }

   for(int i=0;i&lt;iAdmins;i++) //Admin Prüfung
        {
        if(bb[i].getBenutzername()==strInput[0])
                {
                if(bb[i].getPasswort()==strInput[1])
                        {
                        bAdminchk=true;
                        }
                }
        }
   if(strInput[0]==&quot;admin&quot;&amp;&amp;&quot;bsb&quot;==pw(strInput[1])) //std Admin Prüfung
        {
        bAdminchk=true;
        }
   if(bUserchk)
        break;
   if(bAdminchk)
        break;
   clrscr();
   cout&lt;&lt;&quot;Falscher Benutzername oder Passwort&quot;;
   }

   getchar();
   getchar();
   return 0;
}
//---------------------------------------------------------------------------
</code></pre>
<p>bevor ich den Teil in der while(1) Schleife geschrieben habe gings.<br />
Ich nutze üprigens den Borland C++ Builder 6.</p>
<p>soll ich die Headerdatein noch posten ??</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1007162</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1007162</guid><dc:creator><![CDATA[walljumper]]></dc:creator><pubDate>Thu, 02 Mar 2006 21:10:28 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit vector on Fri, 03 Mar 2006 05:39:56 GMT]]></title><description><![CDATA[<p>ich glaub es macht mehr sinn wenn du dich mit deinem debugger auseinandersetzt. (als den header auch noch zu posten)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1007271</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1007271</guid><dc:creator><![CDATA[daHa]]></dc:creator><pubDate>Fri, 03 Mar 2006 05:39:56 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit vector on Fri, 03 Mar 2006 20:46:22 GMT]]></title><description><![CDATA[<p>Mit dem Debugger komm ich leider nicht klar. <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>In der Fehlermeldung steht etwas von einer Zugriffsverletzung.<br />
Der Debuger springt in die _vector.h zu dieser zeile</p>
<pre><code class="language-cpp">~vector() { _Destroy(this-&gt;_M_start, this-&gt;_M_finish); }
</code></pre>
<p>edit:</p>
<p>hab mir mal das Debugg tutorial angeschaut, wirklich geholfen hat mir das zwar nicht, aber ich habe den fahler trotzdem gefunden nur verstehen tu ich ihn nicht.<br />
In der Settings.h<br />
vorher:</p>
<pre><code class="language-cpp">#include&lt;string&gt;
#include&lt;fstream&gt;
#include&lt;iostream&gt;
#include&lt;conio&gt;
#include&lt;vector&gt;
//include&lt;stdlib&gt;
using namespace std;
</code></pre>
<p>nachher</p>
<pre><code class="language-cpp">#include&lt;string&gt;
#include&lt;fstream&gt;
#include&lt;iostream&gt;
#include&lt;conio&gt;
#include&lt;vector&gt;

using namespace std;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1007948</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1007948</guid><dc:creator><![CDATA[walljumper]]></dc:creator><pubDate>Fri, 03 Mar 2006 20:46:22 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit vector on Fri, 03 Mar 2006 21:17:54 GMT]]></title><description><![CDATA[<p>das war nicht der fehler^^ willst du uns verschaukeln!?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1008062</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1008062</guid><dc:creator><![CDATA[strummelbunzi]]></dc:creator><pubDate>Fri, 03 Mar 2006 21:17:54 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit vector on Fri, 03 Mar 2006 21:53:45 GMT]]></title><description><![CDATA[<p>naja jetzt funktionierts und sonst hab ich nix geändert.<br />
Ich sag ich verstehs nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1008095</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1008095</guid><dc:creator><![CDATA[walljumper]]></dc:creator><pubDate>Fri, 03 Mar 2006 21:53:45 GMT</pubDate></item></channel></rss>