<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[hello_shadow的专栏]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/hello_shadow</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; hello_shadow]]></copyright><item><title><![CDATA[cmake指定mingw编译器的方法]]></title><link>https://blog.youkuaiyun.com/hello_shadow/article/details/90713354</link><guid>https://blog.youkuaiyun.com/hello_shadow/article/details/90713354</guid><author>hello_shadow</author><pubDate>Fri, 31 May 2019 11:38:30 +0800</pubDate><description><![CDATA[准备工作：先安装cmake和mingw g++编译器。

一：新建一个测试工程，工程文件夹里面需要有两个文件：

    分别是CMakeLists.txt和main.cpp。关于CMakeLists.txt怎么编写，可以查找cmake相关信息。

二：CMD里先CD到工程目录下，然后运行命令：cmake.exe -G "MinGW Makefiles"

三：运行命令：mingw32-m...]]></description><category></category></item><item><title><![CDATA[singleton的实现代码]]></title><link>https://blog.youkuaiyun.com/hello_shadow/article/details/23762413</link><guid>https://blog.youkuaiyun.com/hello_shadow/article/details/23762413</guid><author>hello_shadow</author><pubDate>Tue, 15 Apr 2014 15:23:17 +0800</pubDate><description><![CDATA[#include #include 
#include 
using namespace std;
template
class Singleton
{
public:

    static T* Instance()
    {
       if(ObjectPtr.get()==NULL)
            ObjectPtr.reset(new T());
        retu]]></description><category></category></item><item><title><![CDATA[浮点数整数部分和小数部分的分离]]></title><link>https://blog.youkuaiyun.com/hello_shadow/article/details/8824295</link><guid>https://blog.youkuaiyun.com/hello_shadow/article/details/8824295</guid><author>hello_shadow</author><pubDate>Fri, 19 Apr 2013 14:54:17 +0800</pubDate><description><![CDATA[void PrintFloat(float value)
{
    int FloatValue = *reinterpret_cast(&value);
    if(FloatValue&0x80000000)  //最高位为符号位
        cout<<"-"<<endl;
    int Exp = (FloatValue>>23)&0xff; //取得指数字段，一个字节。第二到第]]></description><category></category></item><item><title><![CDATA[关于二级指针]]></title><link>https://blog.youkuaiyun.com/hello_shadow/article/details/7751188</link><guid>https://blog.youkuaiyun.com/hello_shadow/article/details/7751188</guid><author>hello_shadow</author><pubDate>Mon, 16 Jul 2012 13:47:56 +0800</pubDate><description><![CDATA[#include 
#include 
#include 
using namespace std;
struct mst
{
	int *a;//对齐，扩展为8字节
	double f;
	int *b;
	int *c;
};
int main()
{
	mst st;
	int array1[2]= {1,2};
	int array2[3]= {3,4,5};
	int array3[2]]]></description><category></category></item><item><title><![CDATA[关于二维指针的代码]]></title><link>https://blog.youkuaiyun.com/hello_shadow/article/details/7748718</link><guid>https://blog.youkuaiyun.com/hello_shadow/article/details/7748718</guid><author>hello_shadow</author><pubDate>Sun, 15 Jul 2012 14:59:20 +0800</pubDate><description><![CDATA[#include 
#include 
using namespace std;
struct mst
{
    int *a;
    double f;
    int *b;
    int *c;
};
int main()
{
    mst st;
    int array1[2]={1,2};
    int array2[3]={3,4,5};]]></description><category></category></item><item><title><![CDATA[C++ builder 网络聊天程序]]></title><link>https://blog.youkuaiyun.com/hello_shadow/article/details/7708876</link><guid>https://blog.youkuaiyun.com/hello_shadow/article/details/7708876</guid><author>hello_shadow</author><pubDate>Mon, 02 Jul 2012 15:54:53 +0800</pubDate><description><![CDATA[#include 
#pragma hdrstop

#include "main.h"
//---------------------------------------------------------------------------
#pragma link "ScktComp"
#pragma resource "*.dfm"
TChatForm *ChatForm;]]></description><category></category></item><item><title><![CDATA[大端模式和小端模式]]></title><link>https://blog.youkuaiyun.com/hello_shadow/article/details/7478689</link><guid>https://blog.youkuaiyun.com/hello_shadow/article/details/7478689</guid><author>hello_shadow</author><pubDate>Thu, 19 Apr 2012 19:00:45 +0800</pubDate><description><![CDATA[大端格式：在这种格式中，字数据的高字节存储在低地址中，而字数据的低字节则存放在高地址中;
小端格式：与大端存储格式相反，在小端存储格式中，低地址中存放的是字数据的低字节，高地址存放的是字数据的高字节。

判断计算机系统是大端还是小端的代码：

bool isBig_Endian()
{
	unsigned short test=0x1234;
	if(*((unsigned char*)]]></description><category></category></item><item><title><![CDATA[写着玩的代码]]></title><link>https://blog.youkuaiyun.com/hello_shadow/article/details/7443053</link><guid>https://blog.youkuaiyun.com/hello_shadow/article/details/7443053</guid><author>hello_shadow</author><pubDate>Mon, 09 Apr 2012 22:27:10 +0800</pubDate><description><![CDATA[#include
#include
#include
void output_empty(int n)
{
	for(int i=0;i<n;i++)
	{
		printf(" ");
	}
}
int main()
{
	int i,j;
	for(int k=0;k<60;k++)
	{
		for(i=1;i<=5;i++)
		{
			output_empty(k);
			 for(]]></description><category></category></item><item><title><![CDATA[MFC消息映射宏展开后代码]]></title><link>https://blog.youkuaiyun.com/hello_shadow/article/details/7296593</link><guid>https://blog.youkuaiyun.com/hello_shadow/article/details/7296593</guid><author>hello_shadow</author><pubDate>Sun, 26 Feb 2012 22:26:26 +0800</pubDate><description><![CDATA[const AFX_MSGMAP* theClass::GetMessageMap() const 
{ 
	return GetThisMessageMap(); 
} 
const AFX_MSGMAP* PASCAL theClass::GetThisMessageMap() 
{ 
		typedef theClass ThisClass;						   
		typedef baseC]]></description><category></category></item><item><title><![CDATA[C++指向类成员函数的指针]]></title><link>https://blog.youkuaiyun.com/hello_shadow/article/details/7268409</link><guid>https://blog.youkuaiyun.com/hello_shadow/article/details/7268409</guid><author>hello_shadow</author><pubDate>Fri, 17 Feb 2012 16:49:17 +0800</pubDate><description><![CDATA[最近在开发中用到了函数指针，于是想整理了一下有关函数指针的概念。O(∩_∩)O~
首先 函数指针是指向一组同类型的函数的指针；而类成员函数我们也可以相似的认为，它是指向同类中同一组类型的成员函数的指针，当然这里的成员函数更准确的讲应该是指非静态的成员函数。前者是直接指向函数地址的，而后者我们从字面上也可以知道 它肯定是跟类和对象有着关系的。
函数指针实例：
typedef int (*p)(]]></description><category></category></item><item><title><![CDATA[C++中实现C#属性相似的语法]]></title><link>https://blog.youkuaiyun.com/hello_shadow/article/details/7266308</link><guid>https://blog.youkuaiyun.com/hello_shadow/article/details/7266308</guid><author>hello_shadow</author><pubDate>Fri, 17 Feb 2012 00:38:33 +0800</pubDate><description><![CDATA[#include
#include
using namespace std;

template
ResultFunction  function_cast(Function fun)
{
    ResultFunction result=ResultFunction(*(reinterpret_cast(&fun)));
    return result;
}


template//,ty]]></description><category></category></item><item><title><![CDATA[数组大小作为参数传递（通过模板数值参数）]]></title><link>https://blog.youkuaiyun.com/hello_shadow/article/details/7257888</link><guid>https://blog.youkuaiyun.com/hello_shadow/article/details/7257888</guid><author>hello_shadow</author><pubDate>Tue, 14 Feb 2012 13:54:29 +0800</pubDate><description><![CDATA[#include
#include
using namespace std;
template
void OutputArraySize(type (&ar)[size])
{
    cout<<"the array size is:"<<size<<endl;
}
int main()
{
	int ar[5];
	double dous[10];
	OutputArraySize(ar);]]></description><category></category></item><item><title><![CDATA[数值计算的符号转换和溢出]]></title><link>https://blog.youkuaiyun.com/hello_shadow/article/details/7248240</link><guid>https://blog.youkuaiyun.com/hello_shadow/article/details/7248240</guid><author>hello_shadow</author><pubDate>Fri, 10 Feb 2012 12:37:50 +0800</pubDate><description><![CDATA[#include
#include
using namespace std;
int main()
{
	unsigned short x=32;
	signed short y=-35;
	unsigned short z=x+y;//y根据singed short会被隐式转换为unsigned short，y会被转换成无符号数
	cout<<z<<endl;//结果为65535+1-y+x。此]]></description><category></category></item><item><title><![CDATA[拷贝构造函数]]></title><link>https://blog.youkuaiyun.com/hello_shadow/article/details/7243836</link><guid>https://blog.youkuaiyun.com/hello_shadow/article/details/7243836</guid><author>hello_shadow</author><pubDate>Wed, 08 Feb 2012 22:41:46 +0800</pubDate><description><![CDATA[拷贝构造函数是C++最基础的概念之一，大家自认为对拷贝构造函数了解么？请大家先回答一下三个问题:
1. 以下函数哪个是拷贝构造函数,为什么?

X::X(const X&);    X::X(X);    X::X(X&, int a=1);    X::X(X&, int a=1, b=2);   
 2. 一个类中可以存在多于一个的拷贝构造函数吗?
3. 写出以下程序段的输出结果,]]></description><category></category></item><item><title><![CDATA[mem_fun和bind2nd的用法例子]]></title><link>https://blog.youkuaiyun.com/hello_shadow/article/details/7217132</link><guid>https://blog.youkuaiyun.com/hello_shadow/article/details/7217132</guid><author>hello_shadow</author><pubDate>Sat, 28 Jan 2012 22:42:48 +0800</pubDate><description><![CDATA[#include
#include
#include
using namespace std;
class Widget:public unary_function
{
    int id;
   public:
        Widget(int x):id(x){}
        void Multiply(int x) const
        {]]></description><category></category></item><item><title><![CDATA[C++中通过自定义operator new 实现内存分配跟踪]]></title><link>https://blog.youkuaiyun.com/hello_shadow/article/details/7213971</link><guid>https://blog.youkuaiyun.com/hello_shadow/article/details/7213971</guid><author>hello_shadow</author><pubDate>Sun, 22 Jan 2012 20:31:33 +0800</pubDate><description><![CDATA[#include
#include
using namespace std;
void* operator new(size_t size,const char *msg,int line)
{
    cout<<"the file:"<<(char*)msg<<" line number:"<<line<<" and size is:"<<size<<endl;
    return mall]]></description><category></category></item><item><title><![CDATA[auto_ptr预防作为STL容器元素的实现。]]></title><link>https://blog.youkuaiyun.com/hello_shadow/article/details/7212944</link><guid>https://blog.youkuaiyun.com/hello_shadow/article/details/7212944</guid><author>hello_shadow</author><pubDate>Sat, 21 Jan 2012 00:03:36 +0800</pubDate><description><![CDATA[#include
#include
#include
#include
using namespace std;
class Widget
{
	public:
        Widget(int _id):id(_id){}
        void SayHello()
        {
            cout<<"my id:"<<id<<endl;
        }
		~]]></description><category></category></item><item><title><![CDATA[优化问题关于const第二篇]]></title><link>https://blog.youkuaiyun.com/hello_shadow/article/details/7110330</link><guid>https://blog.youkuaiyun.com/hello_shadow/article/details/7110330</guid><author>hello_shadow</author><pubDate>Wed, 28 Dec 2011 23:27:40 +0800</pubDate><description><![CDATA[int main()
{
    const int maxint=100;//此段代码放到main函数外程序会运行时崩溃掉
    int &msg=const_cast(maxint);
    msg*=200;
    print_value(maxint);
    cout<<"max:"<<maxint<<endl;
    return 0;
}]]></description><category></category></item><item><title><![CDATA[类的引用类型成员]]></title><link>https://blog.youkuaiyun.com/hello_shadow/article/details/7007383</link><guid>https://blog.youkuaiyun.com/hello_shadow/article/details/7007383</guid><author>hello_shadow</author><pubDate>Thu, 24 Nov 2011 11:35:09 +0800</pubDate><description><![CDATA[#include 
using namespace std;
class Object
{
    int &count;
	public:
		Object(int &cou):count(cou){};
		//如果函数为Object(int cou)则count引用了形参。
		~Object(){};
		void SetValue(int cou)
		{
		    count=cou]]></description><category></category></item><item><title><![CDATA[MS C++的for each关键字]]></title><link>https://blog.youkuaiyun.com/hello_shadow/article/details/6618704</link><guid>https://blog.youkuaiyun.com/hello_shadow/article/details/6618704</guid><author>hello_shadow</author><pubDate>Wed, 20 Jul 2011 08:19:01 +0800</pubDate><description><![CDATA[#include "stdafx.h"
#include 
#include 
#include 
#include 
#include 
using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
    std::]]></description><category></category></item></channel></rss>