Ver Mensaje Individual
  #4 (permalink)  
Antiguo 01/05/2014, 17:35
Avatar de Drewermerc
Drewermerc
 
Fecha de Ingreso: febrero-2014
Mensajes: 185
Antigüedad: 10 años, 3 meses
Puntos: 5
Respuesta: Problema al copiar una linea de un vector

hola urban94.
buen esntonces tu codigo debe quedar asi. espero que si sea lo que andas buscando.
te cambie el for por el while por que en lo pensonal si se saber el valor inicial y el final y aparte incrementa algo me acomodo mas usando for.

Código C++:
Ver original
  1. void BuscoLinea(ofstream& v1, const vector<string>& p1){
  2.         int i = 0;
  3.         int  pos ;
  4.         char m[100];
  5.         cout << pos<< endl;
  6.  
  7.             for(i = 0; i < p1.size(); i++){
  8.                 pos= p1[i].find("ho");
  9.                 if(pos == 0){
  10.                     v1 << p1[i] << endl;
  11.                 }
  12.                  
  13.                 //pos = p1[i].find("hola");
  14.             }
  15.    
  16.    
  17.     }