Reading from file

I'm trying to read float values from a text file into a two dimensional array while counting the entries in the x and y directions. What I've got at the moment is

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
	textData = fopen("test.txt", "r");
	if(textData == NULL)
	{
		printf("Error opening file\n");
		return 1;
	}

	while(fgetc(textData) != EOF)
	{
		i = 0;
		do{
			fscanf(textData, "%f%c", data[i][j], c);//error
			i++;
		}while(c != '\n');
		j++;
	}

	fclose(textData);

	x = i;
	y = j;


All of it compiles fine, but at the commented line, I get an unhandled exception. VC++ tells me "Unhandled exception at 0x102ddd6f (msvcr100d.dll) in CreateImagev2.exe: 0xC0000005: Access violation writing location 0x00000000."

Any idea what the issue I'm looking at is?
Forgot my ampersands. I am not a very clever man.
Topic archived. No new replies allowed.