hi all, thankyou once agian for your help the other day, but once agian i have been banging my head against a brick wall and need to call on your wisdom.

I have a text file containing hex values of the form

12 3
24 7
23 78
10 98

(maxium of 2 hex values per colum, 8 bits but sometimes there is only one!)

where the first colum contains an address and the second a data value to be written to that address. I need to read the file into an array of the form

address[2014]
data[2014]

as their are 2014 lines of code.

my attempt so far is :-

Code:
#include <stdio.h>


void display(int a, int v)  ;

int main()

{

	FILE *file_ptr;
	int address[2014], value[2014], i, j;
	
	file_ptr = fopen("C:\\Documents and Settings\\Owner\\Desktop\\sta013.txt","rt");
	if (file_ptr !=NULL)
	{
		printf("settings file found\n");
		
		
		i=0;
		while (i<1024)
			{
				i++;
				fscanf(file_ptr,"%0x",&address[i]);
				fscanf(file_ptr,"%0x",&value[i]);
			}
			
		printf("total number of values read %d\n",i);
		for (j=0; j<i-1;j++)
			{
			
			
			display(address[j],value[j]);
			
			
			
			
			}
		fclose(file_ptr);
		return 0;
	}
	else
		printf("file not found\n");
		return 0;
}


void display(int a,int v)
{
	printf("%x	%x\n", a,v);

}

however this gives the following results

Code:
settings file found
total number of values read 2014
e7ff0010	                e7ff0010
e800e800	e800e800
e7ff0010	                e7ff0010
e800e800	e800e800
etc ...                       etc...
would really appreciate any help! this little problem is stopping my completing vital code for my thesis and i am really stressed. Unfortunately code is not my strongest point so i may have dont something silly. but please point it out.

Thankyou all.