
April 13th, 2004, 01:28 AM
|
 |
Contributing User
|
|
Join Date: Apr 2004
Location: Frostbite capital of the world
Posts: 542
 
Time spent in forums: 16 h 58 m 34 sec
Reputation Power: 10
|
|
|
#include <iostream>
ifstream fin;
fin.open("FILENAME.txt");
char ch;
while (!fin.eof()){
fin>>ch;
}
//that'll read in a char at a time. if ch is declared as a string type it'll read in a word at a time. If you have to save the words to an array and read them in as chars, you'll have to check for spaces, and reassemble the characters between spaces into a word.
Last edited by fisch : April 13th, 2004 at 01:40 AM.
|