Choose Category
#include <stdio.h> int main(void){ FILE *fp; if((fp=fopen("test", "w"))==NULL) { printf("Cannot open file.\n"); exit(1); } char *str = "www.java2s.com"; for(; *str; str++){ putc(*str, fp); } }