在 C 中使用 pread()

问题描述

我试图使用 pread() 读取文件,但我得到“函数‘pread’的隐式声明在 C99 中无效”。有什么办法可以解决这个问题吗?

#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>

int main(int argc,char **argv) 
{
        char dst[20];
        int file = open("file.txt",O_RDONLY);
        int read_res = pread(file,dst,10,3);
        close(file);
        return 0;
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)