<?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[Übergabe stimmt nicht]]></title><description><![CDATA[<p>Hi Leute!<br />
Ich hänge jetzt schon eine Weile über meinem Programm und bekomme nicht die gewünschten Ergebnisse raus. Ich lese eine csv Datei ein und verarbeite die gewonnenen Daten in einem Algorithmus. Dann werden die Ergebnisse wieder in eine csv Datei ausgegeben. Es kommen aber nur Nullen raus und das kann nicht sein, denn wenn ich die ersten Zeilen per Hand rechne, ist dies nicht der Fall.</p>
<p>Ich habe dann den Algorihtmus alleine getestet und ihm Werte vorgegeben und er funktioniert einwandfrei. Es muß scheinbar an der Übergabe liegen. Ich finde aber nicht den Fehler.</p>
<p>Vielleicht findet ihr ihn ja:</p>
<pre><code>#include &lt;fstream&gt;
#include &lt;string&gt;
#include &lt;iostream&gt;
#include &lt;math.h&gt;

using namespace std;

int main(int argc, char **argv) {

    double av_price = 40.1475;
    long int quote = 50000;
    long int limit = 250000;

    struct zeile{
         double posit;          
         string time;           
         double stk;            
         double orderVol;      
         bool traderID;         
         bool market;          
         bool buy;             
         bool agent;            
         double MXBVol;         
         double MXVol;          
         double GVol;           
         double GXBVol;        
         double GMXBVol;        
         double GMXVol;         
         bool glatt;            
     };

/******************************************************************************/

     struct zeile n[2];

     {
     // Initialisierung des Startwertes der Iteration:
     n[0].posit = 0;
     n[0].stk = 0;
     n[0].orderVol= n[0].stk * av_price;
     n[0].traderID = false;
     n[0].market=false;
     n[0].buy = false;
     n[0].agent = false;
     n[0].MXBVol = 0.0;
     n[0].MXVol = 0.0;
     n[0].GVol = 0.0;
     n[0].GXBVol = 0.0;
     n[0].GMXBVol = 0.0;
     n[0].GMXVol = 0.0;
     n[0].glatt = false;
     }    

     string ids[] = {&quot;BVMMU&quot;, &quot;CITDU&quot;, &quot;CBKFR&quot;, &quot;COSNU&quot;, &quot;DABMU&quot;, 
                     &quot;BFGFR&quot;, &quot;PLUHH&quot;, &quot;DBKFR&quot;, &quot;DRBFR&quot;, &quot;TUBDU&quot;, &quot;QUENU&quot;};

     ifstream inFile(&quot;SAP1611.txt&quot;); 

     if (!inFile.good()) {
         cerr &lt;&lt; &quot;Error opening input-file&quot; &lt;&lt; endl;
         exit(1);
     }

     // das ist die Ausgabedatei:
     fstream f;
     f.open(&quot;ausgabe.csv&quot;, ios::out);

	 //erste Zeile:
     f &lt;&lt; &quot;time;pos;MXBVol;MXVol;GMXVol;GMXBVol;GXBVol;GVol;glatt&quot; &lt;&lt; endl;

     string line;
     string tmpString;

     string time;
     string traderID;
     double price; 
     double number;
     string market_limit;
     string buy_sell;
     string agent_prop;
     int pos;
     int dec_pos;
     int j = 0;           // zählt die Schleifendurchläufe

     int offset;

     // reading header information ...
     //getline(inFile,line);

/***************************************************************************/
/*   Hier fängt die Hauptschleife an, bearbeitet pro Durchlauf eine Zeile: */
    while (inFile.good()) {

    /* 
        n[0] ist immer die Vorgängerzeile, n[1] die aktuelle!*/

       /*Die Zuweisung erfolgt hier: */
    if (j&gt;0){
        n[0].posit=n[1].posit;
        n[0].orderVol=n[1].orderVol;
        n[0].GVol=n[1].GVol;
        n[0].GXBVol=n[1].GXBVol;
        n[0].GMXBVol=n[1].GMXBVol;
        n[0].GMXVol=n[1].GMXVol;
        n[0].MXBVol=n[1].MXBVol;
        n[0].MXVol=n[1].MXVol;
    }

     // hier muss n[1] für jeden Schleifendurchlauf neu initialisiert werden...
     n[1].posit = 0;
     n[1].stk = 0;
     n[1].orderVol=n[1].stk * av_price;
     n[1].traderID = false;
     n[1].market=false;
     n[1].buy = false;
     n[1].agent = false;
     n[1].MXBVol = 0.0;
     n[1].MXVol = 0.0;
     n[1].GVol = 0.0;
     n[1].GXBVol = 0.0;
     n[1].GMXBVol = 0.0;
     n[1].GMXVol = 0.0;
     n[1].glatt = false;

    getline(inFile,line);
    if (line.empty()){
         break;
    }
    // buy_sell
    offset = 56;
    line = line.substr(offset,((int)line.length()-offset));

    pos = line.find('&quot;');
    if (pos != 0){
         buy_sell = line.substr(0,pos);
    }
    if(buy_sell==&quot;B&quot;){      
        n[1].buy = true;
    }    

    //time
    offset = 2;
    line=line.substr(offset+pos,((int)line.length()-offset-pos));
    pos=line.find(';');
    time=line.substr(0,pos);

    n[1].time=time;

    //number
    offset = 8;
    line = line.substr(pos+offset,((int)line.length()-pos-offset)); 
    pos = line.find(',');
    if (pos != 0){
         tmpString = line.substr(0,pos);
         number = atof(tmpString.c_str());
    }
    n[1].stk=number;

    n[1].orderVol= n[1].stk * av_price;    /* kann erst hier initialisiert werden... */

    // trader ID
    offset = 5;
    line = line.substr(pos+offset,((int)line.length()-pos-offset));
    pos = line.find('&quot;');
    traderID = line.substr(0,pos);

    for( int x=0; x&lt;=10; x++){  
        if(traderID==ids[x]){
            n[1].traderID=true;
        }    
    }    

    //market limit
    offset = 2;
    line = line.substr(pos+offset,((int)line.length()-pos-offset)); 
    pos = line.find('&quot;');
    if(pos!=0){
               market_limit=line.substr(0,pos);
               }
    if(market_limit == &quot;M&quot; || market_limit == &quot;L&quot;){
                    n[1].market = true;
                    }  

    //agent
    offset=3;
    line=line.substr(pos+offset,((int)line.length()-pos-offset));
    pos=line.find('&quot;');
    if (pos != 0){
         agent_prop = line.substr(0,pos);
    }
    if(agent_prop == &quot;A&quot;){     
        n[1].agent = true;
    }    

    //market_limit
    offset=3;
    line=line.substr(pos+offset,((int)line.length()-pos-offset));
    pos=line.find('&quot;');
    if (pos != 0){
       market_limit = line.substr(0,pos);
    }
    if (market_limit == &quot;M&quot;){  
        n[1].market = true;
    }  

     /**************************************************************************/
     //hier jetzt mein Algorithmus:

     for(int i=1; i &lt; 2; i++)  // nur ein Durchlauf
     {
         if((n[i].orderVol)&lt;=quote){                                                            // Abschnitt 1
             if(n[i].traderID == true &amp;&amp; n[i].agent == true &amp;&amp; n[i].market == true){                                     // Abschnitt 2a
                 n[i].orderVol = (n[i].buy == true) ? (n[i].orderVol * (-1)) : n[i].orderVol;   // Abschnitt 3a
                 n[i].posit=n[i-1].posit + n[i].orderVol;                                           // Abschnitt 4a
                 if(((n[i-1].posit&gt;0) &amp;&amp; (n[i].posit&lt;0))||((n[i-1].posit&lt;0) &amp;&amp; (n[i].posit&gt;0))          // Abschnitt 5a
                    || ((n[i-1].posit!=0) &amp;&amp; (n[i].posit==0))){
                        n[i].MXBVol = 2*fabs(n[i-1].posit);
                        n[i].GXBVol= fabs(n[i].orderVol)+n[i-1].GXBVol;
                        n[i].GVol= fabs(n[i].orderVol)+n[i-1].GVol;
                        n[i].GMXBVol=n[i-1].GMXBVol+(2*fabs(n[i-1].posit));
                        n[i].GMXVol=n[i-1].GMXVol;
                        n[i].glatt = false;
                        continue;
                 }
                 if(((n[i-1].posit&gt;0) &amp;&amp; (n[i].posit&gt;0) &amp;&amp; ((fabs(n[i-1].posit)-fabs(n[i].posit))&gt;0)) ||  // Abschnitt 6a
                    ((n[i-1].posit&lt;0) &amp;&amp; (n[i].posit&lt;0) &amp;&amp; ((fabs(n[i-1].posit)-fabs(n[i].posit))&gt;0))){
                     n[i].MXBVol = 2*(fabs(n[i-1].posit)-fabs(n[i].posit));
                     n[i].GXBVol= fabs(n[i].orderVol)+n[i-1].GXBVol;
                     n[i].GVol= fabs(n[i].orderVol)+n[i-1].GVol;
                     n[i].GMXBVol=n[i-1].GMXBVol+(2*(fabs(n[i-1].posit)-fabs(n[i].posit)));
                     n[i].GMXVol=n[i-1].GMXVol;
                     n[i].glatt = false;
                     continue;   
                 }
                 else{                                                                          // Abschnitt 7a
                     n[i].GXBVol= fabs(n[i].orderVol)+n[i-1].GXBVol;
                     n[i].GVol= fabs(n[i].orderVol)+n[i-1].GVol;
                     n[i].GMXVol=n[i-1].GMXVol;
                     n[i].GMXBVol=n[i-1].GMXBVol;
                     if(n[i].posit&gt;=limit){
                         n[i].posit=limit/2;
                         n[i].glatt=true;
                         continue;
                     }        
                     continue;
                 }        
             }
             //=================================================================================
             else{                                                                              // ab hier 2b
                 // hier wird die andere Seite reingeparsed.... Überflüssig, oder?
             }        
             //==================================================================================
         }//=====================================================================================
         if(n[i-1].posit==0){                                                                     // Abschnitt 2b
             n[i].posit=n[i-1].posit;
             n[i].GVol=n[i-1].GVol;
             n[i].GXBVol=n[i-1].GXBVol;
             n[i].GMXBVol=n[i-1].GMXBVol;
             n[i].GMXVol=n[i-1].GMXVol;
             continue;
         }
         else{
             if(((n[i-1].posit&lt;0) &amp;&amp; (n[i].buy == true))||((n[i-1].posit&gt;0) &amp;&amp; (n[i].buy == false))){

                     n[i].posit=n[i-1].posit;
                     n[i].GVol=n[i-1].GVol;
                     n[i].GXBVol=n[i-1].GXBVol;
                     n[i].GMXBVol=n[i-1].GMXBVol;
                     n[i].GMXVol=n[i-1].GMXVol;
                     continue;
             }
             else{                                                                          // Abschnitt 4b
                  if(fabs(n[i-1].posit)&gt;fabs(n[i].orderVol)){
                  n[i].orderVol = (n[i].buy == true) ? (n[i].orderVol * (-1)) : n[i].orderVol;
                  n[i].posit=n[i-1].posit + n[i].orderVol;                 
                  }                         
             }
             n[i].MXVol = 2*(fabs(n[i-1].posit)-fabs(n[i].posit));
             n[i].GXBVol= n[i-1].GXBVol;
             n[i].GVol= (fabs(n[i-1].posit)-fabs(n[i].posit))+n[i-1].GVol;
             n[i].GMXBVol=n[i-1].GMXBVol;
             n[i].GMXVol=n[i-1].GMXVol+(2*(fabs(n[i-1].posit)-fabs(n[i].posit)));    
         }  

     }

     // Hier ist die Ausgabe der jeweiligen Zeile in die Datei

     f &lt;&lt; n[1].time &lt;&lt; &quot;;&quot; &lt;&lt; n[1].posit &lt;&lt; &quot;;&quot; &lt;&lt; n[1].MXBVol &lt;&lt; &quot;;&quot; &lt;&lt; n[1].MXVol &lt;&lt; &quot;;&quot; &lt;&lt; n[1].GMXVol 
       &lt;&lt; &quot;;&quot; &lt;&lt; n[1].GMXBVol &lt;&lt;&quot;;&quot;&lt;&lt; n[1].GXBVol &lt;&lt; &quot;;&quot; &lt;&lt; n[1].GVol &lt;&lt; &quot;;&quot; &lt;&lt; n[1].glatt &lt;&lt; endl;

     j++;
     }

     /* Hier hört die Hauptschleife auf!*/
     /******************************************************************************/

     cout &lt;&lt; &quot;\nread &quot; &lt;&lt; j &lt;&lt; &quot; lines of input &quot; &lt;&lt; endl; 
     inFile.close();
     f.close();

     string userInput;
     cout &lt;&lt; &quot;any key to continue ...&quot; &lt;&lt; endl;
     cin &gt;&gt; userInput;

}
</code></pre>
<p>Ich weiß es ist nicht die schönste Programmierung....ist erst eine meiner ersten. Ich muß noch üben:)</p>
<p>Vielen Dank für jeden Versuch!!</p>
<p>zehnsim</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/168636/übergabe-stimmt-nicht</link><generator>RSS for Node</generator><lastBuildDate>Wed, 16 Sep 2026 12:15:14 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/168636.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 25 Dec 2006 21:38:59 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Übergabe stimmt nicht on Mon, 25 Dec 2006 21:38:59 GMT]]></title><description><![CDATA[<p>Hi Leute!<br />
Ich hänge jetzt schon eine Weile über meinem Programm und bekomme nicht die gewünschten Ergebnisse raus. Ich lese eine csv Datei ein und verarbeite die gewonnenen Daten in einem Algorithmus. Dann werden die Ergebnisse wieder in eine csv Datei ausgegeben. Es kommen aber nur Nullen raus und das kann nicht sein, denn wenn ich die ersten Zeilen per Hand rechne, ist dies nicht der Fall.</p>
<p>Ich habe dann den Algorihtmus alleine getestet und ihm Werte vorgegeben und er funktioniert einwandfrei. Es muß scheinbar an der Übergabe liegen. Ich finde aber nicht den Fehler.</p>
<p>Vielleicht findet ihr ihn ja:</p>
<pre><code>#include &lt;fstream&gt;
#include &lt;string&gt;
#include &lt;iostream&gt;
#include &lt;math.h&gt;

using namespace std;

int main(int argc, char **argv) {

    double av_price = 40.1475;
    long int quote = 50000;
    long int limit = 250000;

    struct zeile{
         double posit;          
         string time;           
         double stk;            
         double orderVol;      
         bool traderID;         
         bool market;          
         bool buy;             
         bool agent;            
         double MXBVol;         
         double MXVol;          
         double GVol;           
         double GXBVol;        
         double GMXBVol;        
         double GMXVol;         
         bool glatt;            
     };

/******************************************************************************/

     struct zeile n[2];

     {
     // Initialisierung des Startwertes der Iteration:
     n[0].posit = 0;
     n[0].stk = 0;
     n[0].orderVol= n[0].stk * av_price;
     n[0].traderID = false;
     n[0].market=false;
     n[0].buy = false;
     n[0].agent = false;
     n[0].MXBVol = 0.0;
     n[0].MXVol = 0.0;
     n[0].GVol = 0.0;
     n[0].GXBVol = 0.0;
     n[0].GMXBVol = 0.0;
     n[0].GMXVol = 0.0;
     n[0].glatt = false;
     }    

     string ids[] = {&quot;BVMMU&quot;, &quot;CITDU&quot;, &quot;CBKFR&quot;, &quot;COSNU&quot;, &quot;DABMU&quot;, 
                     &quot;BFGFR&quot;, &quot;PLUHH&quot;, &quot;DBKFR&quot;, &quot;DRBFR&quot;, &quot;TUBDU&quot;, &quot;QUENU&quot;};

     ifstream inFile(&quot;SAP1611.txt&quot;); 

     if (!inFile.good()) {
         cerr &lt;&lt; &quot;Error opening input-file&quot; &lt;&lt; endl;
         exit(1);
     }

     // das ist die Ausgabedatei:
     fstream f;
     f.open(&quot;ausgabe.csv&quot;, ios::out);

	 //erste Zeile:
     f &lt;&lt; &quot;time;pos;MXBVol;MXVol;GMXVol;GMXBVol;GXBVol;GVol;glatt&quot; &lt;&lt; endl;

     string line;
     string tmpString;

     string time;
     string traderID;
     double price; 
     double number;
     string market_limit;
     string buy_sell;
     string agent_prop;
     int pos;
     int dec_pos;
     int j = 0;           // zählt die Schleifendurchläufe

     int offset;

     // reading header information ...
     //getline(inFile,line);

/***************************************************************************/
/*   Hier fängt die Hauptschleife an, bearbeitet pro Durchlauf eine Zeile: */
    while (inFile.good()) {

    /* 
        n[0] ist immer die Vorgängerzeile, n[1] die aktuelle!*/

       /*Die Zuweisung erfolgt hier: */
    if (j&gt;0){
        n[0].posit=n[1].posit;
        n[0].orderVol=n[1].orderVol;
        n[0].GVol=n[1].GVol;
        n[0].GXBVol=n[1].GXBVol;
        n[0].GMXBVol=n[1].GMXBVol;
        n[0].GMXVol=n[1].GMXVol;
        n[0].MXBVol=n[1].MXBVol;
        n[0].MXVol=n[1].MXVol;
    }

     // hier muss n[1] für jeden Schleifendurchlauf neu initialisiert werden...
     n[1].posit = 0;
     n[1].stk = 0;
     n[1].orderVol=n[1].stk * av_price;
     n[1].traderID = false;
     n[1].market=false;
     n[1].buy = false;
     n[1].agent = false;
     n[1].MXBVol = 0.0;
     n[1].MXVol = 0.0;
     n[1].GVol = 0.0;
     n[1].GXBVol = 0.0;
     n[1].GMXBVol = 0.0;
     n[1].GMXVol = 0.0;
     n[1].glatt = false;

    getline(inFile,line);
    if (line.empty()){
         break;
    }
    // buy_sell
    offset = 56;
    line = line.substr(offset,((int)line.length()-offset));

    pos = line.find('&quot;');
    if (pos != 0){
         buy_sell = line.substr(0,pos);
    }
    if(buy_sell==&quot;B&quot;){      
        n[1].buy = true;
    }    

    //time
    offset = 2;
    line=line.substr(offset+pos,((int)line.length()-offset-pos));
    pos=line.find(';');
    time=line.substr(0,pos);

    n[1].time=time;

    //number
    offset = 8;
    line = line.substr(pos+offset,((int)line.length()-pos-offset)); 
    pos = line.find(',');
    if (pos != 0){
         tmpString = line.substr(0,pos);
         number = atof(tmpString.c_str());
    }
    n[1].stk=number;

    n[1].orderVol= n[1].stk * av_price;    /* kann erst hier initialisiert werden... */

    // trader ID
    offset = 5;
    line = line.substr(pos+offset,((int)line.length()-pos-offset));
    pos = line.find('&quot;');
    traderID = line.substr(0,pos);

    for( int x=0; x&lt;=10; x++){  
        if(traderID==ids[x]){
            n[1].traderID=true;
        }    
    }    

    //market limit
    offset = 2;
    line = line.substr(pos+offset,((int)line.length()-pos-offset)); 
    pos = line.find('&quot;');
    if(pos!=0){
               market_limit=line.substr(0,pos);
               }
    if(market_limit == &quot;M&quot; || market_limit == &quot;L&quot;){
                    n[1].market = true;
                    }  

    //agent
    offset=3;
    line=line.substr(pos+offset,((int)line.length()-pos-offset));
    pos=line.find('&quot;');
    if (pos != 0){
         agent_prop = line.substr(0,pos);
    }
    if(agent_prop == &quot;A&quot;){     
        n[1].agent = true;
    }    

    //market_limit
    offset=3;
    line=line.substr(pos+offset,((int)line.length()-pos-offset));
    pos=line.find('&quot;');
    if (pos != 0){
       market_limit = line.substr(0,pos);
    }
    if (market_limit == &quot;M&quot;){  
        n[1].market = true;
    }  

     /**************************************************************************/
     //hier jetzt mein Algorithmus:

     for(int i=1; i &lt; 2; i++)  // nur ein Durchlauf
     {
         if((n[i].orderVol)&lt;=quote){                                                            // Abschnitt 1
             if(n[i].traderID == true &amp;&amp; n[i].agent == true &amp;&amp; n[i].market == true){                                     // Abschnitt 2a
                 n[i].orderVol = (n[i].buy == true) ? (n[i].orderVol * (-1)) : n[i].orderVol;   // Abschnitt 3a
                 n[i].posit=n[i-1].posit + n[i].orderVol;                                           // Abschnitt 4a
                 if(((n[i-1].posit&gt;0) &amp;&amp; (n[i].posit&lt;0))||((n[i-1].posit&lt;0) &amp;&amp; (n[i].posit&gt;0))          // Abschnitt 5a
                    || ((n[i-1].posit!=0) &amp;&amp; (n[i].posit==0))){
                        n[i].MXBVol = 2*fabs(n[i-1].posit);
                        n[i].GXBVol= fabs(n[i].orderVol)+n[i-1].GXBVol;
                        n[i].GVol= fabs(n[i].orderVol)+n[i-1].GVol;
                        n[i].GMXBVol=n[i-1].GMXBVol+(2*fabs(n[i-1].posit));
                        n[i].GMXVol=n[i-1].GMXVol;
                        n[i].glatt = false;
                        continue;
                 }
                 if(((n[i-1].posit&gt;0) &amp;&amp; (n[i].posit&gt;0) &amp;&amp; ((fabs(n[i-1].posit)-fabs(n[i].posit))&gt;0)) ||  // Abschnitt 6a
                    ((n[i-1].posit&lt;0) &amp;&amp; (n[i].posit&lt;0) &amp;&amp; ((fabs(n[i-1].posit)-fabs(n[i].posit))&gt;0))){
                     n[i].MXBVol = 2*(fabs(n[i-1].posit)-fabs(n[i].posit));
                     n[i].GXBVol= fabs(n[i].orderVol)+n[i-1].GXBVol;
                     n[i].GVol= fabs(n[i].orderVol)+n[i-1].GVol;
                     n[i].GMXBVol=n[i-1].GMXBVol+(2*(fabs(n[i-1].posit)-fabs(n[i].posit)));
                     n[i].GMXVol=n[i-1].GMXVol;
                     n[i].glatt = false;
                     continue;   
                 }
                 else{                                                                          // Abschnitt 7a
                     n[i].GXBVol= fabs(n[i].orderVol)+n[i-1].GXBVol;
                     n[i].GVol= fabs(n[i].orderVol)+n[i-1].GVol;
                     n[i].GMXVol=n[i-1].GMXVol;
                     n[i].GMXBVol=n[i-1].GMXBVol;
                     if(n[i].posit&gt;=limit){
                         n[i].posit=limit/2;
                         n[i].glatt=true;
                         continue;
                     }        
                     continue;
                 }        
             }
             //=================================================================================
             else{                                                                              // ab hier 2b
                 // hier wird die andere Seite reingeparsed.... Überflüssig, oder?
             }        
             //==================================================================================
         }//=====================================================================================
         if(n[i-1].posit==0){                                                                     // Abschnitt 2b
             n[i].posit=n[i-1].posit;
             n[i].GVol=n[i-1].GVol;
             n[i].GXBVol=n[i-1].GXBVol;
             n[i].GMXBVol=n[i-1].GMXBVol;
             n[i].GMXVol=n[i-1].GMXVol;
             continue;
         }
         else{
             if(((n[i-1].posit&lt;0) &amp;&amp; (n[i].buy == true))||((n[i-1].posit&gt;0) &amp;&amp; (n[i].buy == false))){

                     n[i].posit=n[i-1].posit;
                     n[i].GVol=n[i-1].GVol;
                     n[i].GXBVol=n[i-1].GXBVol;
                     n[i].GMXBVol=n[i-1].GMXBVol;
                     n[i].GMXVol=n[i-1].GMXVol;
                     continue;
             }
             else{                                                                          // Abschnitt 4b
                  if(fabs(n[i-1].posit)&gt;fabs(n[i].orderVol)){
                  n[i].orderVol = (n[i].buy == true) ? (n[i].orderVol * (-1)) : n[i].orderVol;
                  n[i].posit=n[i-1].posit + n[i].orderVol;                 
                  }                         
             }
             n[i].MXVol = 2*(fabs(n[i-1].posit)-fabs(n[i].posit));
             n[i].GXBVol= n[i-1].GXBVol;
             n[i].GVol= (fabs(n[i-1].posit)-fabs(n[i].posit))+n[i-1].GVol;
             n[i].GMXBVol=n[i-1].GMXBVol;
             n[i].GMXVol=n[i-1].GMXVol+(2*(fabs(n[i-1].posit)-fabs(n[i].posit)));    
         }  

     }

     // Hier ist die Ausgabe der jeweiligen Zeile in die Datei

     f &lt;&lt; n[1].time &lt;&lt; &quot;;&quot; &lt;&lt; n[1].posit &lt;&lt; &quot;;&quot; &lt;&lt; n[1].MXBVol &lt;&lt; &quot;;&quot; &lt;&lt; n[1].MXVol &lt;&lt; &quot;;&quot; &lt;&lt; n[1].GMXVol 
       &lt;&lt; &quot;;&quot; &lt;&lt; n[1].GMXBVol &lt;&lt;&quot;;&quot;&lt;&lt; n[1].GXBVol &lt;&lt; &quot;;&quot; &lt;&lt; n[1].GVol &lt;&lt; &quot;;&quot; &lt;&lt; n[1].glatt &lt;&lt; endl;

     j++;
     }

     /* Hier hört die Hauptschleife auf!*/
     /******************************************************************************/

     cout &lt;&lt; &quot;\nread &quot; &lt;&lt; j &lt;&lt; &quot; lines of input &quot; &lt;&lt; endl; 
     inFile.close();
     f.close();

     string userInput;
     cout &lt;&lt; &quot;any key to continue ...&quot; &lt;&lt; endl;
     cin &gt;&gt; userInput;

}
</code></pre>
<p>Ich weiß es ist nicht die schönste Programmierung....ist erst eine meiner ersten. Ich muß noch üben:)</p>
<p>Vielen Dank für jeden Versuch!!</p>
<p>zehnsim</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1197797</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1197797</guid><dc:creator><![CDATA[zehnsim]]></dc:creator><pubDate>Mon, 25 Dec 2006 21:38:59 GMT</pubDate></item></channel></rss>