库函数调用 5--fseek
2015-06-21 19:12
211 查看
#include <stdio.h> /*************************** *name:fseek.c *author:QG *time :2015-05-12 *description: ****************************/ int main() { FILE *fp_in; char *in_file_name = "./123.txt"; char c_buf[10]; int a = 0; fp_in = fopen(in_file_name,"r+"); a = fseek(fp_in,2,SEEK_SET); if(a == 0) { printf("location OK!\n"); } else if(a == -1) { printf("location fail!\n"); } fread(c_buf,1,9,fp_in); c_buf[9] = '\0'; printf("read content is : %s!\n",c_buf); close(fp_in); return 0; }
相关文章推荐
- 博客读后感
- 计算脚本执行时间
- 库函数调用 3--fread
- hdu4612Warm up tarjan+树形dp
- 库函数调用 2--fclose
- jQuery对象和DOM对象之间的相互转换
- js实现购物车(源码)
- 微软的最高市值是多少?
- bootstrap的对话框和提示信息
- hdoj 3501 Calculation 2
- iBeacon
- 库函数调用 1--fopen
- 窗体自定义路径显示图片(Java)
- 2014年11月日本6日跟团游小结
- Tutorial 7 Rotation Transformation
- android 日历动画的实现
- hdu 5272 Dylans loves numbers
- 系统调用 8--综合实例(txt_to_txt)
- Unity该插件NGUI学习(1)—— 环境结构
- CSMAR数据库券商名称简写归类