i got this last function not working... giving me error C2087 : 'array2' : missing subscript in line 59, last function that is... anyone know what the problem might be? 10x
CODE
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <stdlib.h>
#include <math.h>
#define SIZE 100
double random_no ();
double arcsine (double value);
int file ();
int main (void)
{
int i, j, a ,b;
int array1[101][181] = {0};
float rno;
srand (time(NULL));
for (i=0; i<10000; i++)
{
rno = random_no();
a = 51-(50*(rno));
b = 91 + arcsine (rno);
array1[a][b] = 1;
}
for (i=0; i<101; i++)
{
for (j=0; j<181; j++)
{
file (array1[i][j]);
printf ("%d", array1[i][j] );
}
}
return (0);
}
double random_no ()
{
return (((double)rand() / (RAND_MAX) * 2 ) -1);
}
double arcsine (double value)
{
return ((asin(value))*360 / 6.283185);
}
int file (int array2[][])
{
FILE *cfPtr;
int i,j;
(cfPtr = fopen ("question 1.dat", "w"));
while (!feof(cfPtr))
{
fprintf (cfPtr, "%d", array2 [i][j]);
}
fclose (cfPtr);
return (array2[i][j]);
}