摘要:rhs: right hand side. 用于表示等号右边的值。lhs: left hand side. 等号左边的值。
阅读全文
摘要:关于缩进============"将缩进风格设置为C-Styleset cindent "将Shift键的宽度设置为4,即每次手动按下Tab键,将移动四个字符的距离set tabstop=4 "number of spaces to use for indent,即设置缩进的宽度set shiftwidth=4"设置public protected private这些C++声明 置于所在代码块的N个字符后"个人习惯于这些关键字位于行首,即与大括号对齐,不缩进。"要通过设置cindent option来进行设置,如下:set cino=
阅读全文
摘要:看到这样一段代码:template<class_Ty> inline _Ty _FARQ *_Allocate(_SIZT _Count, _Ty _FARQ *){ //check for integer overflow if(_Count <= 0) _Count = 0; else if(((_SIZE)(-1)/_Count) < sizeof(_Ty)) _THROW_NCEE(std::bad_alloc, NULL); //allocate storage for _Count elements of type _Ty return((_Ty _FARQ
阅读全文
摘要:1) #define是预处理指令,在编译预处理时进行简单的替换,不作正确性检查,不关含义是否正确照样带入,只有在编译已被展开的源程序时才会发现可能的错误并报错。例如:#define PI 3.1415926程序中的:area=PI*r*r 会替换为3.1415926*r*r如果你把#define语句中的数字9 写成字母g 预处理也照样带入。2)typedef是在编译时处理的。它在自己的作用域内给一个已经存在的类型一个别名,但是You cannot use the typedef specifier inside a functiondefinition。3)typedef int * int_
阅读全文
摘要:字符串--->时间: COleDateTime temp1; COleDateTime temp2; temp1.ParseDateTime(_T("9999-12-12")); temp2.ParseDateTime(_T("15:05:05")); 时间转换成字符串:COleDateTime beginTime(dlg.m_oleStartTime1.GetYear(), dlg.m_oleStartTime1.GetMonth(), dlg.m_oleStartTime1.GetDay(), dlg.m_oleStartTime2.GetHo
阅读全文
摘要:来源自:http://www.cppblog.com/snailcong/archive/2009/03/16/76705.html程序说明一切://环境:vc6 + windows sp2//程序1#include <iostream>using namespace std;struct st1 { char a ; int b ; short c ;};struct st2{ short c ; char a ; int b ;};int main(){ cout<<"sizeof(st1) is "<<sizeof(st1)<
阅读全文
摘要:背景:BCGControlsPropSheet类是从CBCGPPropertySheet类继承来的,做了一些修改,以满足项目的需求。效果图:但是将左侧的图标(ImageList)写死了,现在需要修改。经查看,该类的构造函数定义为:lass BCGControlsPropSheet : public CBCGPPropertySheet{ DECLARE_DYNAMIC(BCGControlsPropSheet)// Constructionpublic: BCGControlsPropSheet(const CString strTitle=_T(""),CWnd* pPa
阅读全文
摘要:在~/bash.rc中添加:alias gvim='gvim -f' 添加完后需要Logout一次,变量才能生效。man了一下-f选项,解释如下: -f Foreground. For the GUI version, Vim will not fork and detach from the shell it was started in. On the Amiga, Vim is not restarted to open a new window. This option ...
阅读全文
摘要:error LNK2005: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) 已经在 LIBCMTD.lib(dbgdel.obj) 中定义答案:修改project-> setting -> General-> Mircosoft Fountationclasses为Use mfc in a shard dll 分析:原来的是“使用windows库”,这样可能多次包含了库。 技巧:查看搜索库的顺序:选择VC菜单Project->Settings->Link页,然后在Project Op
阅读全文
摘要:VB中没有像MFC中设置TAB键顺序的快捷键,因此: 设定各控件的Tab键的顺序可以 a.从想要的顺序的最后一个起,将该项的TabIndex值设定为0 b.将倒数第二个控件,TabIndex设置为0 c.倒数第三个…… d.一直进行到想要顺序的第一个控件 原理:将一个控件的TabIndex设置为0时,原来为0的为变为1,1的变为2…… 都加1.这样设置一遍时,最后被设置的为0,最先设置的为N,其余从0到N 递增。(按照设想顺序)
阅读全文
摘要:最开始的错误:D:\PROGRA~1\MATLAB\R2010B\BIN\MEX.PL: Error: 'Files\OpenCV-2.2.0\vs2005_ForXue\include\opencv' not found. ??? Error using ==> mex at 208Unable to complete successfully.Error in ==> compile at 32 eval(['mex lk.cpp -O' include lib]); 第一行Error:'Files\...'其实已经露出个马脚,我
阅读全文
摘要:参考文档 1.OpenCV论坛的安装文档之“VC 2008 Express下安装OpenCV2.0/2.1” http://www.opencv.org.cn/index.php/Template:Install 2.在上述安装文档开始指明的:官方安装文档。 http://opencv.willowgarage.com/wiki/InstallGuide我用的是vs2005和Opencv2.2。显然论坛上的2008不能满足我的需求,官方给出只有针对2010的安装包,为了避免日后出现什么诡异的问题,还是自己编译好。在WIN下编译安装软件还是比较方便的,不像在LINUX下需要频繁的安装各种依赖库/
阅读全文