1.
#include
2.
3.
void main()
4.
{
5.
//Define the arrays for angle and sine
6.
int a[25];
7.
double s[25];
8.
9.
//Grab the filename
10.
char* name = new char[];
11.
printf("Load Sine Values\nFile Name: ");
12.
gets(name);
13.
14.
//Create the file pointer and open it
15.
FILE* in = fopen(name,"rt");
16.
17.
//Read from the file
18.
int n = 0;
19.
while(fscanf(in, "%i%lf", &a[n], &s[n]) == 2) n++;
20.
21.
//Display Proof
22.
printf("\nLoaded %i entries from %s\n", n, name);
23.
printf("---------------------------------------\n");
24.
for(int k=0; k