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

📄 test.c

📁 linux下的字符设备驱动代码
💻 C
字号:
#include <stdio.h>int main(){	 char *source="1234567890";         char destination[12];         destination[11]='\0';         int fd=open("/dev/VFIFO",2);         if(fd==-1){               printf("file open fail!!\n");	       return 0;         }         write(fd,source,10);         close(fd);         fd=open("/dev/VFIFO",2);         if(fd==-1){               printf("file open fail!!\n");	       return 0;         }         read(fd,destination,10);         close(fd);         printf("The data translated by the virtual device VFIFO is: %s\n",destination);	 return 0;} 

⌨️ 快捷键说明

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