#include <stdio.h>
int fgetpos(FILE *stream, fpos_t *pos);
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
int main()
{
fpos_t position;
FILE *stream;
char mingyan[1000];
char *p = mingyan;
stream = fopen("my4.txt", "r");
if (stream == NULL){
perror("errno");
exit(1);
}
fread(p, 3, 1, stream);
fgetpos(stream, &position);
printf("pos is %d\n", position);
printf("pos is %d\n", position.__pos);
fclose(stream);
return 0;
}
beyes@linux-beyes:~/BBS/3ins/ins> ./read.exe
pos is 3
pos is 3
typedef _G_fpos_t fpos_t;
typedef struct
{
__off_t __pos;
__mbstate_t __state;
} _G_fpos_t;
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |