I'm working on a program to score a bowling game. Right now, my terminal says that my program has a seg fault, but I can't tell where. Any other insight on how to help my program do what it's supposed to do would be helpful. I'm still not sure how to weed out all the characters, although I think my fscanf might do that.

/*
 *  This program is designed to open an existing file, lane9.txt,
 *  which has a collection of integers and characters.  It then takes
 *  the characters out, leaving only the integers and spaces.
 */

#include <stdio.h>
int main ()
{
FILE* fp;
fp = fopen("lane9.txt", "r");
int i;
int throw[i];
int n = 20;
if (fp == NULL)
{
	printf("Error: file lane9.txt could not be opened\n");
	return 0;
}
for (i = 0; i < n; i++)
{
	fscanf(fp,"%2d %*s", &throw[i]);
}
for(i=0;i<n; i++);
{
	printf("%d ",throw[i]);
}
return 0;
}
commented: This is not a code snippet. -5

What do you need with this code ?

How big is throw[] since i has no value?

WaltP is write, That is 'i' is a local variable. It have a garbage value, It is very high.