How do you read from a file using C programing

Recommended Answers

All 3 Replies

Dont know about plain C but in C++ i use th use iostream and fstream libaries and then use the ifstream and ofstream objects to manipulate the I/O streams.

commented: Such a completely useless post. -3
commented: I disagree, it is useful. +17

This is easy question to C/C++ guys if you posted at their forums.
In python it is as simple as
open("filename.extensin", "mode")
for example f = open("assignment.tx", "r")

fopen, then fread() or fgets() depending on what kind of file you're trying to read. Why don't you go look it up, because I don't feel like helping someone who's too lazy to even bother posting their questions in the right forum.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.