View Single Post
Old 05-04-2004, 07:53 AM   #5 (permalink)
jello
Registered User
 
Join Date: May 2004
Location: cincinnati
Posts: 3
jello is on a distinguished road
Send a message via AIM to jello
Sorry for the lack of clarity in my original post. I didn't even think to look for the "[code]" tags. Anyway, the code I do have is from my professor. Aparently it is possible to modify it to do what I need. Here it is:
Code:
#include<string>
#include<fstream>
#include<iostream>

int main()
{
    ifstream input("devilish tasks.txt");
    
    string word;
    input >> word;

    while( !input.eof())
       {std::cout << "\"" << word <<    "\""                     << std::endl; 
        input >> word ;
       }
    return 0;
}
Also, I switched from a struct to a class.

One thing I forgot to mention is that I am using a g++ compiler.
jello is offline   Reply With Quote