Hello all,
That's my first post in here so I'm not sure if I'm gonna be very clear. I hope I will.
In C, I need to open a variable number of files stored in nFiles in a loop so I can write a piece of text in each file and keep appending text to them. So, basically, I need to reopen the files every time until I'm done appending text to them. The problem is that it works for the first file, but when the first loop is done, the second loop crashes when executing the line of fopen. I don't know the reason why.
It still doesn't work. I inserted some printf to check what's going on and it's still the same thing: it opens the first file, does all the fprintf stuff that i need it to do, but when it comes to open the second file it crashes again.
Thanks a lot Zaita, but any idea what could be happening?