I would have written instead (warning, no error-checking performed):
#include <stdio.h>
#include <stdlib.h>
#define BUFSIZE 100
#define SIZE 10
int main()
{
char buf[BUFSIZE];
int a[SIZE][2];
FILE * fp = fopen("test.dat", "r");
int count = 0;
while (fgets(buf, BUFSIZE, fp))
{
if (sscanf(buf, "%d %d", &a[count][0], &a[count][1]) == 2)
count++;
}
int n;
for (n=0; n<count; ++n)
{
printf("%d %d\n", a[n][0], a[n][1]);
}
fclose(fp);
return 0;
}