I want to use the dirent.h library to list all the file names of a folder (files type .txt) but that as they are being listed, they are also saved in a string type variable that is also opening it in reading mode with an ifstream. I do not know if you made me understand, the goal is to list some information from .txt files whose names are very big numbers, try it with a for but this progresses quite slow, I attach the for code.
#include <iostream>
#include <fstream>
#include <dirent.h> //aqui la libreria que quiero utilizar.
#include <string>
#include <sstream>
long int x;
string z;
for(x=60400000; x<10000000000; ++x){
string result;
stringstream convert; //Convert de int a string
convert<<x;//Señalamos la variable a convertir
result=convert.str();//x queda guardada en una variable result con los
//valores de x
z=result+".txt";
/*cout<<z;*///Descomentar para ver el proceso de busqueda.
ifstream file(z.c_str());//Abre la variable z que depende del for.
if (!file){
}
else{
string a,b,c,d,e,f,g,h,i;
file >>a>>b>>c>>d>>e>>f>>g>>h>>i;//Doy un nombre a cada linea del archivo
cout<<"Nombre: "<<a<<" "<<"Celular: "<<c<<" "<<"Fecha de pago: "<<h<<" "<<endl;//Imprimo las lineas que necesito especificamente