开发者社区> 问答> 正文

C++程序汉化问题(借鉴Qt)

之前初步学习了Qt的汉化,想知道Qt汉化能不能以及如何应用到非Qt的C++文件上呢,谢谢。

展开
收起
a123456678 2016-03-09 09:41:52 1908 0
1 条回答
写回答
取消 提交回答
  •  #include  <iostream>
    #include <fstream>
    #include <string>
    #include <map>
    using namespace std;
    int main()
    {
        wifstream in("1.txt");
        setlocale(LC_ALL, "");
    wchar_ttemp;
    map<wchar_t, int> cnt;
        while(!in.eof())
    {
    in >> temp;
            cnt[temp]++;
    }
    typedef map<wchar_t, int>::const_iterator map_iter;
    for(map_iter it = cnt.begin(); it != cnt.end(); ++it)
        {
            wprintf(L"%lc ", it -> first);
            cout << it -> second << endl;
        }
        return 0;
    }
    2019-07-17 18:55:23
    赞同 展开评论 打赏
问答分类:
C++
问答标签:
问答地址:
相关产品:
问答排行榜
最热
最新

相关电子书

更多
使用C++11开发PHP7扩展 立即下载
GPON Class C++ SFP O;T Transce 立即下载
GPON Class C++ SFP OLT Transce 立即下载

相关镜像