cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
printing txt file
printing txt file
Oct 25, 2009 at 7:14am UTC
AR Khan
(54)
Hi,
I have a problem here. I want to print characters of a text file on the console. I open a file using fopen(). But how to print???
and also, the pointer returned by fopen() points to what??? to first character of the txt file???
Oct 25, 2009 at 7:33am UTC
firedraco
(6243)
Use fread().
Nothing you should care about, it is a layer of abstraction. You just pass it to fread()/fwrite() and it deals with it for you.
Oct 25, 2009 at 7:57am UTC
screw
(145)
http://www.cplusplus.com/reference/clibrary/cstdio/fread/
I think, the ifstream is more convenient than fopen / fread:
http://www.cplusplus.com/reference/iostream/ifstream/open/
Oct 25, 2009 at 1:01pm UTC
AR Khan
(54)
But fread() returns me number of characters read, as an integer???
Topic archived. No new replies allowed.