mardi 30 juin 2015

Trouble understanding file scope in C

I'm having trouble wrapping my head around files in C, specifically scope and duration. Say I create a file using

fopen("random.dat", "w");

How long does this file exist for? Does it get deleted once my program is finished running, or is it somehow reset? If I reopen the file further down in my code, only this time with the "r" reading argument, or "a", will I have conflicting streams since I'm opening a file that is already technically opened?

Aucun commentaire:

Enregistrer un commentaire