📄 test.c
字号:
#include <stdio.h>#include <fcntl.h>#include <sys/ioctl.h>#include <stdlib.h>#include <sys/stat.h>#include <sys/types.h>#include <fcntl.h>#define DEVICE_NAME zjdev#define OPENSPK 1#define CLOSESPK 2char buf[128];int main(){ int f=open(DEVICE_NAME,O_RDONLY); if(f==-1) return 1; printf("\nHit enter key to read device..."); read(f,buf,128); printf(buf); printf("\nHit entr key to write device..."); write(f,"test",4); close(f); }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -