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

📄 read.c

📁 AMCC5933 C语言源码
💻 C
字号:
#include <stdio.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#define NUM 64main(){int i,testdev;unsigned char buf[NUM];for(i=0;i<NUM;i++)	buf[i] = 1;testdev = open("/dev/testpcidevice",O_RDWR);if ( testdev == -1 ){printf("Cann't open file \n");exit(0);}buf[0] = 0x3c;read(testdev,buf,4);for(i=0;i<5;i++)    printf("The No.%d value is :%x\n",i,buf[i]);close(testdev);}

⌨️ 快捷键说明

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