READ是干吗的

2024-12-17 01:25:13
推荐回答(4个)
回答1:

函数名: read
功 能: 从文件中读
用 法: int read(int handle, void *buf, int nbyte);
程序例:

#include
#include
#include
#include
#include
#include

int main(void)
{
void *buf;
int handle, bytes;

buf = malloc(10);

/*
Looks for a file in the current directory named TEST.$$$ and attempts
to read 10 bytes from it. To use this example you should create the
file TEST.$$$
*/
if ((handle =
open("TEST.$$$", O_RDONLY | O_BINARY, S_IWRITE | S_IREAD)) == -1)
{
printf("Error Opening File\n");
exit(1);
}

if ((bytes = read(handle, buf, 10)) == -1) {
printf("Read Failed.\n");
exit(1);
}
else {
printf("Read: %d bytes read.\n", bytes);
}
return 0;
}

“read”在英汉词典中的解释(来源:百度词典):

read1
KK: []
DJ: []
vt.
1. 读,阅读;朗读[O1]
2. 读懂;觉察
3. 读到;获悉[+(that)]
4. 显示;标明;读数为
5. 攻读,研究
6. 理解;解释[(+as)]
7. 用...去代替,改作
8. 【电脑】读;读出;读入[(+in/out)]
vi.
1. 阅读,朗读
2. 读到;获悉
3. 读起来[W][L]
4. 载明;写明[Q]
n.[S]
1. 【英】一段阅读时间
2. 读物
3. 阅读

read2
KK: []
DJ: []
(read的过去式和过去分词)

read3
KK: []
DJ: []
a.
1. (常用以构成复合词或用作表语)有学问的,通晓的[(+in)]

回答2:

解决内存不能为“read”吗???

回答3:

什么意思。。read 是读出的意思

回答4:

阅读。 读写。
读出