⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tom.c

📁 用五个实例来解释linux下的c编程
💻 C
字号:
/* tom.c v2.0 */#include <unistd.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <stdlib.h>#include <stdio.h>#define FILE "message.txt"int main(){  int fd;  char msg[] = "message.txt created by Tom.\n";  ssize_t s;  /* Open file for write. */  fd = open(FILE, O_CREAT | O_TRUNC | O_WRONLY, 0666);  if(fd < 0) {    perror("open");  }  /* Write message. */  s = write(fd, &msg, sizeof(msg)-1);  /* Close file. */  close(fd);  exit(EXIT_SUCCESS);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -