Ver Mensaje Individual
  #2 (permalink)  
Antiguo 05/06/2013, 11:41
amchacon
 
Fecha de Ingreso: julio-2012
Mensajes: 375
Antigüedad: 12 años, 2 meses
Puntos: 28
Respuesta: Duda sobre ficheros.

Estás en C o C++?

En C++:

Código C++:
Ver original
  1. #include <string>
  2. #include <sstream>
  3. #include <fstream>
  4.  
  5. using namespace std;
  6.  
  7. //...
  8.  
  9. stringstream Nombre;
  10. ofstream Guardar;
  11. int i = 1;
  12.  
  13. while (!fi.eof())
  14. {
  15.   Nombre.str(string()); // Limpiamos el stream
  16.   Nombre<<argv[1]<<i; // Generamos el nuevo nombre
  17.   Guardar.open(Nombre.str().c_str()); // Creamos
  18.   i++;
  19. }