Issues with ofstream
<p>I'm finishing this code but I'm wondering why I can't output an archive with ofstream.  </p>

<p>What did I do wrong?</p>

<p>The problem is in the line 61. Compiler says: error, 'struct std::stringstream' has no member named aux4.</p>

<pre><code>#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;conio.h&gt;
#include &lt;string.h&gt;
#include &lt;fstream&gt;
#include &lt;math.h&gt;
#include &lt;iostream&gt;
#include &lt;sstream&gt;



using namespace std;


class  validate { 
       public:
              int aa, mm , dd ;
              string guy;
       public:
              validate ( int x, int y, int z){
                      aa=x; mm=y; dd=z;
              }
       bool check ( int aa, int mm, int dd){
            if ( aa &gt;0){
               if( mm == 01 || mm== 03 || mm == 05 || mm == 07 || mm == 08.0 || mm == 10 || mm == 12){
                   return dd &lt;=31;
                   }
               else if ( mm == 04 || mm == 06 || mm == 09.0 || mm == 11){
                    return dd &lt;=30;
                    }
               else {
                    return dd &lt;=28;
               }
            }
       }
};

int main (){
    int aa, mm, dd, key;
    string name, date, aux1, aux2, aux3;
    stringstream aux4;
    do {

        cout&lt;&lt;"Name:"&lt;&lt;endl;
        cin&gt;&gt;name;
        cout&lt;&lt;"Enter date of birth:"&lt;&lt;endl;
        cin&gt;&gt;date;

        aux1= date.substr(6,9); 
        aa = atoi(aux1.c_str());
        aa=2012-aa;

        aux2= date.substr(3,4);
        aux2=aux2.substr(0,2);
        mm = atoi(aux2.c_str());

        aux3= date.substr(0,2);
        dd = atoi(aux3.c_str());

        aux4 &lt;&lt; dd &lt;&lt; mm &lt;&lt; ".txt";
        ofstream file(aux4.aux4().c_str(), fstream ::app);
        file&lt;&lt;aa&lt;&lt;"years"&lt;&lt;name&lt;&lt;endl;
        file.close();



        cout&lt;&lt;"Enter key != 0 if you want to continue ( Ideally press 1):"&lt;&lt;endl;
        cin&gt;&gt;key;

    }while ( key != 0);
    cout&lt;&lt;"Thanks! End of line."&lt;&lt;endl;

    system ("PAUSE");
    return 0;
};
</code></pre>
