fseek函数c语言
In this article, we’ll take a look at using the fseek() function in C/C++.
在本文中,我们将研究在C / C ++中使用fseek()函数。
fseek() is a very useful function to traverse through a file. We can ‘seek’ to different locations, by moving the file pointer.
fseek()是遍历文件的非常有用的函数。 通过移动文件指针,我们可以“搜索”到不同的位置。
This enables us to control where we can read and write to and from files.
这使我们能够控制在哪里可以读写文件。
Let’s take a look at using this functions, using some illustrative examples!
让我们使用一些说明性示例来看看如何使用此功能!
C / C ++中fseek()的基本语法 (Basic Syntax of fseek() in C/C++)
The fseek()
function will move the file pointer to a file, based on the option that we give it.
fseek()
函数将根据我们提供的选项将文件指针移至文件。
This function is present in the <stdio.h>
header file.
<stdio.h>
头文件中提供了此功能。