My code does not happen any error, it seems in my opinion my fopen() in FILE* file= fopen("008.espresso.din", "r"); can not open the file that i'm using, if it does not happen any error, i don't know what else to do. why i can't open the file ?, 
my data is like this : 
2 400170 8fa40000
0 7ffebc84 0
2 400174 3c1c1001
2 400178 279cc660
2 40017c 27a50004
2 400180 af8589a8
i compile it with gcc -o cache cache.c -lm
here is the code :
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
/* struktur baca */
struct read
{
    int dummy1;
    int address;
    int dummy2;
}read;
/* struktur memory address */
struct memaddress
{
    int tag;
    int set;
}mem;
/*struktur cache */
struct cache
{
    int tag;
    int valid;
};
int main(void)
{
    int i;
    double hitrate;
    double missrate;
    int maskingsetbit;
    struct cache* cache;
    int set=0, bitset;
    int block, bitblock;
    int miss=0;
    int hit=0;
    int total=0;
    /* jumlah cache dan block */
    do{
        printf("Masukkan jumlah set cache:");   
        scanf("%d", &set);
        printf("Masukkan jumlah block:");
        scanf("%d", &block);
        /* hitung jumlah bit */ 
        bitset=log2(set);
        bitblock=log2(block*4);
        maskingsetbit=pow(2,bitset)-1;
        /* periksa jumlah bit */
    }while (bitset+bitblock>31);
    /*alokasi memory pada cache */
    cache=(struct cache*) malloc(set*sizeof(struct cache));
    /* buka file */
    FILE* file= fopen("008.espresso.din", "r");
    /* inisialisasi cache */
    for(i=0;i<set;i++)
    {
        cache[i].valid=0;
        cache[i].tag=0;
    }
    while (!feof(file))
    {
        /* baca data dinero */
        fscanf(file, "%x", &read.dummy1);
        if(feof(file))  
            break;
        fscanf(file, "%x", &read.address);  
        fscanf(file, "%x", &read.dummy2);
        /*pilah bit tag dari address */
        mem.tag = read.address>>(bitblock+bitset);
        mem.set = (read.address>>bitblock)&(maskingsetbit);
        /*hitung total reference */
        total++;
        if(cache[mem.set].valid==0)
        {
            miss++;
            cache[mem.set].valid=1;
            cache[mem.set].tag=mem.tag;
        }else{
            if(cache[mem.set].tag!=mem.tag)
            {
                miss++; 
                cache[mem.set].tag!=mem.tag;
            }else{
                hit++;
            }
        }
        /* hitung hit rate dan miss rate */
        hitrate=hit;
        hitrate=hitrate/total*100;
        missrate=miss;
        missrate=missrate/total*100;
        printf("\n\nTotal Hit\t=%d\n",hit);
        printf("Total Miss\t=%d\n",miss);
        printf("Hitt Rate\t=%.2f%%\n",hitrate);
        printf("Miss Rate\t=%.2f%%\n",missrate);
        printf("Total Reference\t=%d\n",total);
        fclose(file);
        return(0);
    }
}
 
     
    