Write character to stream: how to use putc
#include <stdio.h> int main () { FILE *file; char c; file=fopen("my.txt", "wt"); for (c = 'a' ; c <= 'z' ; c++) { putc (c , file); } fclose (file); return 0; }