📜  在文件中写入 - C 编程语言代码示例

📅  最后修改于: 2022-03-11 15:04:39.930000             🧑  作者: Mango

代码示例2
[...]
  printf("Enter name: \n");
  if (fgets(name, sizeof name, stdin)) {
    fputs(name,fileptr);
    fclose(fileptr);
    printf("File write was successful\n");
  } else {
    printf("Read error.\n");
  }