Your title is totally unacceptable. Use a more proper defined one next time, one which defines your problem more specificaly.
Anyway why do you need to remove const? It needs to be const so as to be acceptable by the compiler.
If you just want at runtime to be able to control the number of files opened you can do it indirectly (this works in my c++ compiler I hope also in your C code)