[edit]Dang, beatenCode:getline( infile, data, 80 );
[edit]Dang, beatenCode:getline( infile, data, 80 );
Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah
You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie
Here is a very quick example, going bed now as i've got to be up at 5 am. :-(
Code:#include <fstream.h> #define BUFF_LEN 80 int main(void) { char Data[BUFF_LEN]; ifstream InFile; InFile.open("Test.txt"); InFile.getline(Data, BUFF_LEN); InFile.close(); cout << Data; getchar(); return 0; }
Be a leader and not a follower.
Don't use old-style headers. Use <fstream> and using namespace std;.
Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah
You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie