- 博客(13)
- 收藏
- 关注
原创 关于wprintf无法打印unicod中文字符的解决方法
void PrintUnicode(){ HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE) ; wchar_t *pszText = L"好好学习" ; WriteConsoleW(hOut, pszText, wcslen(pszText), NULL, NULL ) ;}
2013-06-28 16:36:30 811
原创 代码页 CodePage
#include "stdafx.h"#include void CodePage(int nCodePage){ SetConsoleOutputCP(nCodePage) ; for (int i=0; i<255; ++i) { printf("%c ",i) ; }}int main(int argc, char* argv[]){ CodePage(874)
2013-06-28 09:59:53 675
转载 跟我一起写 Makefile
陈皓 概述 —— 什么是makefile?或许很多Winodws的程序员都不知道这个东西,因为那些Windows的IDE都为你做了这个工作,但我觉得要作一个好的和professional的程序员,makefile还是要懂。这就好像现在有这么多的HTML的编辑器,但如果你想成为一个专业人士,你还是要了解HTML的标识的含义。特别在Unix下的软件编译,你就不能不自己写makefi
2013-06-28 08:30:39 403
转载 安装Red Hat Linux 9.0,所遇错误问题的解决方法
1.安装至第二张时,弹出错误提示。2.鼠标不能使用。 1.安装至第二张时,弹出错误提示。============================================Linux安装指南: 用VMWare7.1 安装Red Hat Linux 9.0,到第二张光盘时出现以下错误信息: 无法打开xpdf-2.01-8软件包。
2013-06-26 10:18:10 1157
原创 C++中的类型转换
reinterpret_cast:将一个指针类型转换为另一个指针类型(不改变指针变量的值)。不能用于非指针类型的转换。double d = 12.3 ;double *pd = &d ;int *pi = reinterpret_cast(pd) ; const_cast:去除指针的常量属性,或者为非常量指针增加常量属性。double d = 123.4 ;co
2013-06-14 10:39:34 428
原创 boost——string_alog字符串的操作(五)
#include #include using namespace boost;using namespace std;int _tmain(int argc, _TCHAR* argv[]){ string str = "Samus, Link.Zelda::Mario-Luigi+zelda" ; deque d ; ifind_all(d, str, "zELDA") ;
2013-06-13 10:29:49 493
原创 boost——string_alog字符串的操作(四)
#include using namespace boost;using namespace std;int _tmain(int argc, _TCHAR* argv[]){ string str = "Samus beat the monster.\n" ; cout << replace_first_copy(str,"Samus", "samus") ; replace
2013-06-13 08:46:15 498
原创 MFC——自绘控件(从CWND派生的edit控件)
头文件:typedef enum tagBKMod{COLOR_MOD, PICTURE_MOD, TRANSPARENT_MOD}BKMod;class CTextWnd : public CWnd{ int m_cxChar ; //字符的平均宽度 int m_cyChar ; //字符的平均高度 int m_nTextPos ; //字符位置的索引 int m_nTex
2013-06-08 19:22:41 3126 3
原创 boost——string_algo字符串的操作(三)
#include #include using namespace boost;using namespace std;int _tmain(int argc, _TCHAR* argv[]){ format fmt("|%s|.pos = %d\n") ; string str("Long long ago, there was a king.") ; iterator_ra
2013-06-08 19:02:13 610
原创 boost——sting_algo字符串的操作(二)
#include #include using namespace boost;using namespace std;int _tmain(int argc, _TCHAR* argv[]){ string str1("Samus"), str2("samus") ; //注意括号第一个调用了函数的构造函数,第二个为重载的()操作符 assert(!is_equal()(s
2013-06-08 17:50:02 710
原创 boost——string_algo字符串的操作(一)
#include using namespace boost;using namespace std;int _tmain(int argc, _TCHAR* argv[]){ string str("readme.txt") ; if (ends_with(str, "txt")) { cout << to_upper_copy (str) + " UPPER" << en
2013-06-08 16:10:05 595
原创 boost——format格式化字符串
#include using namespace boost;using namespace std;int _tmain(int argc, _TCHAR* argv[]){ cout << format("%s: %d + %d = %d, \n") %"sum" %1 %2 %(1+2) ; format fmt("(%1% + %2%) * %2% = %3%\n") ;//
2013-06-08 14:05:58 550
原创 boost——字符串与数字的转换
#include using namespace boost;using namespace std;int _tmain(int argc, _TCHAR* argv[]){ int iVal = lexical_cast("100") ; long lVal = lexical_cast("20000") ; float fVal = lexical_cast("3.14159e
2013-06-08 12:53:40 3419
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人