📜  在 c 编程中写入文件 - 无论代码示例

📅  最后修改于: 2022-03-11 14:58:53.592000             🧑  作者: Mango

代码示例1
[...]
  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");
  }