Thank you for the answer tabstop. Here is the code using your suggestion:
Code:
#include <stdio.h>
main()
{
FILE *archivo;
int one, two, three, four, five, six, seven, eight, success;
char ubicacion[60], buff[30];
printf("ubicacion del archivo: ");
scanf("%s", ubicacion);
if ((archivo = fopen(ubicacion, "r")) == NULL)
printf("File could not be opened\n");
else {
while ( fgets( buff, sizeof buff, archivo ) != NULL ) {
success = sscanf(buff, "%d:%d:%d,%d --> %d:%d:%d,%d", &one, &two, &three, &four, &five, &six, &seven, &eight);
if (success==8) {
printf("%d:%d:%d,%d --> %d:%d:%d,%d\n", &one, &two, &three, &four, &five, &six, &seven, &eight);
}
}
}
return 0;
}
But it still doesn't work. What I get is this:
-1073992452:-1073992456:-1073992460,-1073992464 --> -1073992468:-1073992472:-1073992476,-1073992480
I get that over and over again. I don't know if I implemented your code in a wrong way or what. Hope someone can help me.