C Tutorial/stdio.h/fgetpos — различия между версиями
Admin (обсуждение | вклад) м (1 версия: Импорт контента...) |
(нет различий)
|
Текущая версия на 13:32, 25 мая 2010
fgetpos
Item Value Header
- include <stdio.h>
Declaration int fgetpos(FILE *stream, fpos_t *position); Function stores the current file position indicator. Return returns zero on success or nonzero on failure
"fpos_t *position" is useful only in a call to fsetpos().
<source lang="cpp">#include <stdio.h>
#include <stdlib.h> int main(int argc, char *argv[]) { FILE *fp; fpos_t file_loc; if((fp=fopen("test","r"))==NULL) { printf("Cannot open file.\n"); exit(1); } fgetpos(fp, &file_loc); fclose(fp); }</source>