RSS Forums RSS
Please support our C++ advertiser: Programming Forums

confused

Join Date: Jul 2007
Location: Toronto, Canada
Posts: 20
Reputation: tostrinj is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 1
tostrinj's Avatar
tostrinj tostrinj is offline Offline
Newbie Poster

Help Re: confused

  #6  
Oct 27th, 2007
I have just read the whole thing and I am confused as to what do you have to do here. And I am getting sys. reqs from some crazy manages for a living. So you got to count unique vowels? Can we get an example of the text file? Ancient Dragon is right, got to exit if file is not opened properly, I guess you guys did not study exceptions yet, simple return would do.

Keep in mind, your L1, L2 and L3 are not innitialized and are passed into a your mistery function, that is no good.

While not clearly understanding what do you have to do here, here is my suggestion on how to make at least what you wrote workable:

int main(){
    string line,L1,L2,L3;
    string filename = "vowel.txt";
    ifstream inFile;
    inFile.open("vowel.txt" , ios::in); 
    if ( inFile.fail())
    {
        cout<<"\nThe file is not there or some other terrible thing had happened in the process
               soon we will learn about exceptions and this type of deal would be much easier.\n";
        //exiting with -1 would at least indicate that something bad had happened
        return -1;
    }
    cout<<"We are cooking with gas now"<<endl;
    //i am not sure on reading a line part, have not touched c++ since school
    while(getline(inFile,line))
    {
        cout<<line<<endl;        
        //like I mentioned above, your L* are not innitialized
        vowel(L1, L2, L3);
        return 0;
}
===========================
can you repeat the part of the stuff where you said all about the things?
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 1:54 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC