I'm under the strong impression that I just don't understand how fscanf works.

I have a text file formatted like so:

```
0x01
0x02
0x04
0x08
0x0F
0x1F
0x2F
0x4F

```

And I want to read them in:

```
inline void read_inputs_from_ip_if(){

    if(fscanf(ipf,"%x",&input)==EOF){
        printf("Terminated.");
        exit(0);
    }

    fscanf(ipf,"%x",&input);
}

```

But the issue is that whenever I use a print statement on the input, it yields 0.
I want to read in each line consecutively and execute some decision logic in a never-ending for loop. The issue is that it never reads in any of the inputs at all.

This is the main block:

```
ipf = fopen("input.txt","r");
for (; ; )
{
    read_inputs_from_ip_if();
    printf("Input: %x \n", input);
    control_action();
    write_output_to_op_if();
}

```

As I mentioned earlier, the input never changes from 0.
I was under the impression that fscanf, due to the loop, would read a new line until it reaches the end of the file... Now I'm not so sure.