jerry.c

来自「用五个实例来解释linux下的c编程」· C语言 代码 · 共 29 行

C
29
字号
/* jerry.c v4.0 */#include <unistd.h>#include <sys/types.h>#include <sys/stat.h>#include <sys/wait.h>#include <fcntl.h>#include <stdlib.h>#include <stdio.h>static void pid2str(char * str, pid_t pid){  sprintf(str, "%d", pid);}int main(int argc, char* argv[]){  pid_t pid;  char spid[256];    pid = getpid();  pid2str(spid, pid);    printf("from TOM %s to Jerry %s: %s\n", argv[1], spid , argv[2]);  exit(EXIT_SUCCESS);}

⌨️ 快捷键说明

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