tolower
-
Hi
ich weiß einfach nicht, was an dem Programm nicht stimmen soll, irgendwie hab ich was übersehen anscheinend.#include <iostream> #include <ctype.h> using namespace std; int main(){ char x[20]; int index; cin>>x>>endl; for(int i=0;i<5;i++) { x[i]=tolower(x[i]); } cout<<x<<endl; return 0; }
Als C-code krieg ich das hin, aber mit C++ hab ich noch Probleme.
Gruß
infostud
-
Hallo,
Der Manipulator endl ist nur für ostreams definiert.Caipi
-
#include <iostream> #include <string> #include <cctype> using namespace std; int main(){ std::string x; cin>>x; for(int i=0;i<x.size();i++) x[i]=tolower(x[i]); cout<<x<<endl; }
-
@Windalf:
Vielen Dank!!!