Help me

#include <stdio.h>
#include <stdlib.h>
void main()
{
const int n = 2;
int i;
FILE *Fout[n];
char namafile[50];

for (i=1 ; i<=n ; i++)
{
printf("%d\n", i);
sprintf (namafile, "c:\\OS\\Result %d.txt", i);
Fout[i] = fopen(namafile, "w");
}
for (i=1;i<=n;i++)
{
fprintf(Fout[i], "test %d\n", i);
fclose(Fout[i]);
}
system("pause");
}

It won't work if there's no constant int

Can I change the constant "n", so I can use scanf("%d",&n) ??
thanks
1
2
volatile const int n = 5  
const_cast<int&>(n) = 100;  //remove const 
still declaration syntax man :(
Topic archived. No new replies allowed.