Try this :
while (1)
{
int retval = fscanf(fp,"%d %d\n", &data1,&data2);
if(retval==EOF)
break;
column1[ num_rows ] = data1;
column2[ num_rows ] = data2;
num_rows++;
if(num_rows%10==0)
{
column1 = realloc( column1, (num_rows + 10)*sizeof(int) );
column2 = realloc( column2, (num_rows + 10)*sizeof(int) );
}
}
int i;
for( i=0; i<num_rows; i++ )
{
printf( "%d %d\n", column1[ i ], column2[ i ] );
}
remember to release the memory you have allocated.