int lowercase(char );
cout<<"Please, enter the name of the file: "<<endl;
cout<<" Error: can not open the file!! "<<endl;
cout<<"Please Type :"<<endl;
cout<<" L to count the number of lower case characters ('a' to 'z') in the text "<<endl;
cout<<" U to count the number of upper case characters ('A' to 'Z') in the text "<<endl;
cout<<" D to count the number of digit characters ('0' to '9') in the text "<<endl;
cout<<" O to count the number of other characters (non-alphanumeric) in the text"<<endl;
cout<<" Q to stop the program "<<endl;
cout<<"a is "<<y<<endl;
cout<<"b is "<<y<<endl;
int lowercase(char let)
if(islower(x) && x==let)
the file contain : aabbb
but when the program run it shows a=2 , b=0 !!
there is 3 b in the file!!
Is the problem with 'let'?? i think it stick with 'a' and doesn't change to 'b'!!
The problem is that, by the time you've finished the first call to lowercase, your input stream is positioned at the end of the file. You need to reset it back to the start of the file before you start looking again for the next letter.#
i think the problem is in "let " it stick with 'a' and doesn't change to 'b'
What evidence do you have for that? What behaviour are you seeing that indicates that it's somehow mysteriously not executing the second call to lowercase()?
Have you tried stepping through it with a debugger, to test your theory?