<div dir="ltr">que error te da?<br><br><div class="gmail_quote">El 25 de septiembre de 2008 20:42, Rubén <span dir="ltr"><<a href="mailto:parraymartinez@terra.es">parraymartinez@terra.es</a>></span> escribió:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">



  
  

<div>
<pre>Buenas noches:

Estaba practicando cuando esto me ha dado un error que no he sabido solucionar:

#include <iostream>
#include <fstream>
using namespace std;

int main()
{
        ofstream f2;
        f2.open("fichero.txt", ofstream::out); 


        char nombre[100];  //Cadena de carácteres. 
        cout<<"Escriba su nombre y pulse Intro: ";
        cin >>nombre;  //Lee lo escrito
        f2 << nombre;  //Lo guarda en fichero.txt

                char apellido[100];
                cout<<"Escriba su apellido y pulse Intro: ";
                cin>>apellido;  //Lee el apellido escrito.
                f2<<" ";  //Crea un espacio entre nombre y apellido.
                f2<<apellido;  //Escribe el apellido en fichero.txt

        f2.close("fichero.txt");
        f2.open("fichero.txt", ofstream::in); 
        f2<<apellido;
}

¿Qué estoy haciendo mal?

Un saludo.

Rubén
</pre>
</div>

<br>_______________________________________________<br>
Lista de correo Cconclase <a href="mailto:Cconclase@listas.conclase.net">Cconclase@listas.conclase.net</a><br>
<a href="http://listas.conclase.net/mailman/listinfo/cconclase_listas.conclase.net" target="_blank">http://listas.conclase.net/mailman/listinfo/cconclase_listas.conclase.net</a><br>
Bajas: <a href="http://listas.conclase.net/index.php?gid=2&mnu=FAQ" target="_blank">http://listas.conclase.net/index.php?gid=2&mnu=FAQ</a><br></blockquote></div><br><br clear="all"><br>-- <br> (\__/) <br>(='.'=)This is Bunny. Copy and paste bunny into your <br>
(")_(")signature to help him gain world domination. <br><br>
</div>