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

📄 p4.5.c

📁 linux编程源代码,其中是由大量的实例
💻 C
字号:
#include <stdio.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>int main(void){	char test;	int fd;	if((fd=open("test.dat",O_RDONLY))==-1){	    perror("Cannot open the test.dat file");	    return 1;	}	if(fork()==-1){	    perror("Cannot create the child process");	    return 1;	}	read(fd,&test,1);	printf("Process ID: %ld read the character: %c\n",(long)getpid(),test);        close(fd);	return 0;}

⌨️ 快捷键说明

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