Académique Documents
Professionnel Documents
Culture Documents
char dir[50];
int main()
{
ABB arbolVal=NULL;
ABB arbolconj=NULL;
FILE *archivo;
char line[long];
clrscr;
archivo=fopen("c:\\Primer_Proyecto\\VEHICULOS.txt", "r");
if(archivo==NULL)
{
cout<<"ningun dato en el archivo"<<endl;
exit(0);
}
while(fgets(line,long,archivo)!=NULL)
{
// clrscr();
cout<<"dato\n"<<line<<endl;
getch();
int i, dato;
char var[20]=" ";
char var1[20]=" ";
char var2[20]=" ";
char *aux;
i=0;
aux = strtok(line,",");
{
while(aux!=NULL)
{
if(i==0)
{
strcpy(var,aux);
dato=atoi(var);
insertar
}
if(i==1)
{
strcpy(var1,aux);
//dato=atoi(var1);
}
if(i==2) {
strcpy(var2,aux);
//dato=atoi(var2); }
i=i+1;
aux=strtok(NULL,","); }
cout<<dato<<endl;
cout<<var1<<endl;
cout<<var2<<endl;
//getch(); } }
fclose(archivo);
cout<<"fin del archivo"<<endl;
getch();}