China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-01 15:31
中国DOS联盟论坛 » DOS开发编程 & 发展交流 (开发室) » [Help] How do I read and write a text file in C? View 1,095 Replies 2
Original Poster Posted 2003-08-01 00:00 ·  中国 河南 驻马店 联通
金牌会员
★★★★
龙哥DOS
Credits 4,289
Posts 1,501
Joined 2003-02-23 00:00
23-year member
UID 983
Gender Male
From 河南省
Status Offline
Question for everyone:
How do I use C to read and write a text file in a specified directory? Please give an example. Many thanks!
C++C++C++C++C++C++C++C++C++C++C++C++C++C++C++
C++ ☆☆☆ 中国DOS联盟成员 ☆☆☆ C++
C++ ★★★ 爱提问的红色狂想 ★★★ C++
C++C++C++C++C++C++C++C++C++C++C++C++C++C++C++
Floor 2 Posted 2003-08-01 00:00 ·  中国 安徽 滁州 天长市 电信
银牌会员
★★★
Credits 1,835
Posts 648
Joined 2002-11-08 00:00
23-year member
UID 197
Gender Male
Status Offline
Take a look at this
http://beckenglish.51.net/cbook/book/ch12.htm
Floor 3 Posted 2005-10-07 22:09 ·  中国 上海 松江区 电信
新手上路
Credits 13
Posts 6
Joined 2005-10-06 13:48
20-year member
UID 43162
Gender Male
Status Offline
C can handle many file formats. You just need to use FOPEN(). There's nothing difficult about it.
fgets(),fgetc(),fscanf().
Forum Jump: