首页 > 编程知识 正文

指向函数的指针有什么用,函数指针与指针函数的区别

时间:2023-05-05 16:54:16 阅读:150738 作者:1793

ftell函数用于确定文件位置指针从文件开头开始的当前位置的偏移字节数。 以下是一个简单的例子。

# includeiostreamusingnamespacestd; int main () file*FP=fopen ) ' mydata.txt ',' w ' ); coutftell(FP ) endl; frintf(FP,' 123 ); coutftell(FP ) endl; frintf(FP,' %d ',456 ); coutftell(FP ) endl; flose(FP ); int a; FP=fopen(mydata.txt ),) r ); coutftell(FP ) endl; FSCANF(FP,' %d ',a ); coutftell(FP ) endl; cout a endl; flose(FP ); cout'******endl; int b[10]; memset(b,0,sizeof(b ) b ); FP=fopen('YouRdata ',' wb ' ); coutftell(FP ) endl; write(b,sizeof(b ) b )、1、fp ); coutftell(FP ) endl; flose(FP ); int c[10]; FP=fopen(YouRdata,) rb ); coutftell(FP ) endl; fread(c,sizeof(c ) c )、1、fp ); coutftell(FP ) endl; flose(FP ); 返回0; }

0

3

6

0

6

123456

* * * * * * * * * * * * * * * *

0

40

0

40

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。