Hi all,
The program I wrote compiles, but it always causes a segmentation fault in runtime and I have no idea why.
I'm running this on an Ubuntu whose default locale is "en_EN.UTF-8".Code:#include <iostream> #include <locale> using namespace std; const unsigned int MAXBUF = 2048; int main(int argc, char* argv[]) { const ctype<char>& ct_de = use_facet<ctype<char> >(locale("de_DE.utf8")); char buf[MAXBUF]; char* c; cin.imbue(locale::classic()); cout.imbue(locale::classic()); while(cin.getline(buf, MAXBUF)) { c = buf; while(*c) { cout << ct_de.tolower(*c++); } cout << endl; } return 0; }
A libation and hecatomb for anyone who can help.



LinkBack URL
About LinkBacks


