.......
FILE *fp;
int numbers[100];
int *pts;
int i = 0;
int t = 0;
pts = &numbers[0];
{
random();
for ( t = 0; t < 100; t++)
numbers[t] = rand() % 255;
}
if ((fp=fopen("c:\test.txt", "w+")) == NULL)
{
fprintf(stderr, "can't open file....!
");
exit(1);
}
for (i = 0 ; i < 100; i++);
fprintf(fp, "%d", numbers[t]);
fclose(fp);
}
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Just make 1 change...and your program runs!!!:
: for (i = 0 ; i < 100; i++);
: fprintf(fp, "%d", numbers[t]);
: fclose(fp);
Just remove the ';' from the fol. line..
: for (i = 0 ; i < 100; i++)
...and hey presto! It works!!
Good Luck!
Make another change on the same line..
:for (i = 0 ; i < 100; i++);
:fprintf(fp, "%d", numbers[t]);
:fclose(fp);
fprintf(fp, "%d", numbers[i]);
|
make 't' to 'i'
that's all!!
Bye!