Thread: confused
View Single Post
Join Date: Jul 2007
Posts: 20
Reputation: tostrinj is an unknown quantity at this point 
Solved Threads: 1
tostrinj's Avatar
tostrinj tostrinj is offline Offline
Newbie Poster

Re: confused

 
0
  #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:

  1. int main(){
  2. string line,L1,L2,L3;
  3. string filename = "vowel.txt";
  4. ifstream inFile;
  5. inFile.open("vowel.txt" , ios::in);
  6. if ( inFile.fail())
  7. {
  8. cout<<"\nThe file is not there or some other terrible thing had happened in the process
  9. soon we will learn about exceptions and this type of deal would be much easier.\n";
  10. //exiting with -1 would at least indicate that something bad had happened
  11. return -1;
  12. }
  13. cout<<"We are cooking with gas now"<<endl;
  14. //i am not sure on reading a line part, have not touched c++ since school
  15. while(getline(inFile,line))
  16. {
  17. cout<<line<<endl;
  18. //like I mentioned above, your L* are not innitialized
  19. vowel(L1, L2, L3);
  20. return 0;
  21. }
===========================
can you repeat the part of the stuff where you said all about the things?
Reply With Quote