?? test.c
字號:
#include <stdio.h>
#include <fcntl.h>#include <sys/types.h>#include <sys/stat.h>
char buf[128];
int main(){ int dev_test;
dev_test=open("/dev/mydevice",O_RDWR); if(dev_test==-1) { printf("\nCan't open the device!\n"); return (-1); } printf("\nmy_device opend!"); printf("\nreading...\n"); read(dev_test,buf,128); printf(buf); printf("writing...\n"); write(dev_test,"test",4); printf("my_device closed!\n"); close(dev_test); return 0;}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -