![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++
addfourliu
这个作者很懒,什么都没留下…
展开
-
C++标准转换运算符dynamic_cast
【转自】http://www.cnblogs.com/ider/archive/2011/08/01/cpp_cast_operator_part5.htmlC++标准转换运算符dynamic_castdynamic_cast (expression)dynamic_cast运算符,应该算是四个里面最特殊的一个,因为它涉及到编译器的属性设置,而且牵扯到的面向对转载 2012-07-14 16:58:44 · 482 阅读 · 0 评论 -
Vector remove()和erase()的使用
转载:http://blog.csdn.net/ozwarld/article/details/7761519STL中remove()只是将待删除元素之后的元素移动到vector的前端,而不是删除。若要真正移除,需要搭配使用erase()。例子如下:// remove.cpp#pragma warning(disable: 4786)#include #include转载 2013-05-23 21:31:28 · 1411 阅读 · 0 评论 -
C++多字节与宽字节间的转换(wchar_t与char转换)
转自:http://www.linuxidc.com/Linux/2012-05/60869.htm#include using namespace std; class CUser { public: CUser(); virtual~ CUser(); char* WcharToChar(wchar_t* wc);//宽字节转单字节 wch转载 2013-05-17 16:06:43 · 1482 阅读 · 0 评论 -
程序执行bat文件
方法一:可以通过Qt的QProcess来实现QProcess p;p.start("cmd.exe", QStringList() "/c" "c:\\uti\\mybat.bat");if (p.waitForStarted()) { p.waitForFinished(); qDebug() }else qDe原创 2013-05-17 10:26:05 · 1539 阅读 · 0 评论 -
C++ 内存管理
【转自】http://blog.csdn.net/wczhangshdx/article/details/6649639C++内存管理[导语]内存管理是C++最令人切齿痛恨的问题,也是C++最有争议的问题,C++高手从中获得了更好的性能,更大的自由,C++菜鸟的收获则是一遍一遍的检查代码和对C++的痛恨,但内存管理在C++中无处不在,内存泄漏几乎在每个C++程序中都会发生,转载 2012-07-16 09:55:57 · 3297 阅读 · 0 评论 -
class “类名” 和 include “类名”.h 有什么不同?
// TestInterface.h //------------------------------------------------------------------- class TestImpl; class TestInterface { public: explicit TestInterface( int index ); ~TestIn转载 2012-08-09 19:29:00 · 1335 阅读 · 0 评论 -
C++标准转换运算符const_cast
【转自】:http://www.cnblogs.com/ider/archive/2011/07/22/cpp_cast_operator_part2.htmlC++标准转换运算符const_cast前面讲了C++继承并扩展C语言的传统类型转换方式,最后留下了一些关于指针和引用上的转换问题,没有做详细地讲述。C++相比于C是一门面向对象的语言,面向对象最大的特点之一就是转载 2012-07-14 16:55:06 · 611 阅读 · 0 评论 -
C++标准转换运算符static_cast
【转自】http://www.cnblogs.com/ider/archive/2011/07/31/cpp_cast_operator_part4.htmlC++标准转换运算符static_caststatic_cast (expression)虽然const_cast是用来去除变量的const限定,但是static_cast却不是用来去除变量的static转载 2012-07-14 16:57:56 · 374 阅读 · 0 评论 -
C++简单例子 分别用 数组 和 指针来输出单个字符
首先,用数组的方法//=============================#include using namespace std;int main(void){char str[] = "hello world";for (int i = 0; i cout getchar();}然后,指针的方法//===========原创 2011-08-30 09:54:47 · 699 阅读 · 0 评论 -
指针数组的深入探讨
首先我们来看例子,我们通过例子来弄清楚程序每一步的执行情况//=================================================#include using namespace std;int main(){ char *str[] = {"welcome", "to", "Fortemedia", "NanJing"}; //第1步c原创 2011-08-30 10:54:32 · 399 阅读 · 0 评论 -
C++标准转换运算符reinterpret_cast
【转自】http://www.cnblogs.com/ider/archive/2011/07/30/cpp_cast_operator_part3.htmlC++标准转换运算符reinterpret_castreinterpret_cast (expression)reinterpret_cast运算符是用来处理无关类型之间的转换;它会产生一个新的值,这个值转载 2012-07-14 16:56:39 · 625 阅读 · 0 评论 -
汉字转拼音
#include #include using namespace std;string findLetter(int nCode);string getLetter(string strText){ bool m_blnSimaple=false; bool m_blnFirstBig=true; bool m_blnAllBiG=true; bool转载 2013-06-20 11:26:45 · 1338 阅读 · 0 评论