write a string to file in c