Mega Code Archive

 
Categories / C / Code Snippets
 

Reopen a file

#include <stdio.h> int main(void) { char str[100]; freopen("OUTPUT", "w", stdout); printf("Enter a string: "); gets(str); printf(str); return 0; }