Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Java には、ファイル チャネルから読み取ることができるFileChannelがあります。読み始めたいチャンネルの位置を設定することもできます。
C++/C で同様の関数はありますか?
ifstream::seekg()C++とを調べてくださいifstream::tellg()。C:ftell()およびfseek()関数でも<stdio.h>
ifstream::seekg()
ifstream::tellg()
ftell()
fseek()
<stdio.h>
Cプログラミングによるソリューションが必要な場合
C
位置から読み取りたい場合は、までをX使用fread()して(X-1)再利用するfread()かfgets()、またはfgetc()位置から読み取ることができますX
X
fread()
(X-1)
fgets()
fgetc()
Cの特定の位置までテキストファイルを読み取る方法は?