获取已打开文件的位置

int ftell(int fp);
//fp:文件打开句柄
//返回值 文件读写点位置(相对于文件头)

示例

int fp;
str s;
int pos;
fp=fopen("/a.txt",0x01);
if (fp!=-1){
    //文件打开成功
    s=fgets(fp);
    echo(s);
    pos=ftell(fp);
    echo(pos);
    fclose(fp);
}

备注