Code Snippets C

//Header file: #include
//Declaration: int putc(int ch, FILE *stream);
//Return: returns the character written on success and EOF on error.
#include
int main(void){
FILE *filep;
if((filep=fopen("test", "w"))==NULL) {
printf("Cannot open file.\n");
exit(1);
}
char *str = "I Love Clementine";
for(; *str; str++){
putc(*str, filep);
}
}