<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[ll_0802的专栏]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/ll_0802</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; ll_0802]]></copyright><item><title><![CDATA[函数模板和类模板]]></title><link>https://blog.youkuaiyun.com/ll_0802/article/details/50755245</link><guid>https://blog.youkuaiyun.com/ll_0802/article/details/50755245</guid><author>ll_0802</author><pubDate>Sat, 27 Feb 2016 14:47:00 +0800</pubDate><description><![CDATA[当重载的函数和原函数解决问题的逻辑是一样的，函数体语句也是一样的，不一样的只是处理的数据类型，为了避免代码冗余，可以使用函数模板。
函数模板的语法格式template
示例代码：
#include 
using namespace std;

template
void outputArray (const T *arr, int n){
    for (int i = 0; i < n;]]></description><category></category></item><item><title><![CDATA[多态之override与final]]></title><link>https://blog.youkuaiyun.com/ll_0802/article/details/50752249</link><guid>https://blog.youkuaiyun.com/ll_0802/article/details/50752249</guid><author>ll_0802</author><pubDate>Fri, 26 Feb 2016 20:08:00 +0800</pubDate><description><![CDATA[多态行为的基础是：基类声明一个虚函数，派生类声明一个函数覆盖该函数。
覆盖的要求是函数签名一致。函数签名包括：函数名，参数列表，const
在派生类的函数中声明override，编译器会在编译的过程中检查基类中是否有函数签名一致的虚函数形成多态，否则报错。
在类或者函数中声明final可以避免类被继承，或者函数被覆盖。
示例代码：
struct Base1 final {};
struc]]></description><category></category></item><item><title><![CDATA[纯虚函数和抽象类]]></title><link>https://blog.youkuaiyun.com/ll_0802/article/details/50752139</link><guid>https://blog.youkuaiyun.com/ll_0802/article/details/50752139</guid><author>ll_0802</author><pubDate>Fri, 26 Feb 2016 19:46:10 +0800</pubDate><description><![CDATA[抽象类是带有纯虚函数的类。
纯虚函数在基类中定义，它没有定义任何具体操作，声明格式为 virtual 返回类型  函数名（参数） = 0。
对于暂时无法实现的函数可以定义为纯虚函数，留给派生类实现。
抽象类只能是基类，抽象类不能定义对象。
示例代码：
#include 
using namespace std;

class Base1 {
public:
    virtual voi]]></description><category></category></item><item><title><![CDATA[多态之虚函数]]></title><link>https://blog.youkuaiyun.com/ll_0802/article/details/50751805</link><guid>https://blog.youkuaiyun.com/ll_0802/article/details/50751805</guid><author>ll_0802</author><pubDate>Fri, 26 Feb 2016 19:24:09 +0800</pubDate><description><![CDATA[虚函数实现运行时多态。
虚函数声明只出现在类定义函数原型声明中，而不能在成员函数实现的时候。
虚函数一般不声明为内联函数，因为虚函数访问时需要动态绑定，而内联函数是静态的。
virtual关键字可以省略，当基类中已经声明了虚函数，那么派生类中和基类同返回值，同名，同形参的函数即使没有加virtual也可判定为虚函数。
构造函数不可以是虚函数，西沟函数可以是虚函数。
为什么需要虚析构函数？]]></description><category></category></item><item><title><![CDATA[多态之运算符重载]]></title><link>https://blog.youkuaiyun.com/ll_0802/article/details/50740931</link><guid>https://blog.youkuaiyun.com/ll_0802/article/details/50740931</guid><author>ll_0802</author><pubDate>Thu, 25 Feb 2016 21:55:26 +0800</pubDate><description><![CDATA[1.双目运算符重载
双目运算符重载规则：若要实现表达式oprd1 B oprd2，运算符为B，则需要将B重载为oprd1所属类对象的成员函数，形参为oprd2所属类型
示例代码：复数的加减运算
#include 
using namespace std;

class Complex {
public:
    Complex(double r = 0.0, double i = 0.0)]]></description><category></category></item><item><title><![CDATA[访问从基类继承的成员]]></title><link>https://blog.youkuaiyun.com/ll_0802/article/details/50733889</link><guid>https://blog.youkuaiyun.com/ll_0802/article/details/50733889</guid><author>ll_0802</author><pubDate>Wed, 24 Feb 2016 22:16:13 +0800</pubDate><description><![CDATA[示例代码：
#include 
using namespace std;

class Base1 {
public:
    int var;
    void fun() { cout << "member in Base1" << endl; }
};
class Base2 {
public:
    int var;
    void fun() { cout << "member i]]></description><category></category></item><item><title><![CDATA[派生类构造函数-多继承]]></title><link>https://blog.youkuaiyun.com/ll_0802/article/details/50733729</link><guid>https://blog.youkuaiyun.com/ll_0802/article/details/50733729</guid><author>ll_0802</author><pubDate>Wed, 24 Feb 2016 21:52:07 +0800</pubDate><description><![CDATA[示例代码：
#include 
using namespace std;

class Base1 {
public:
    Base1(int i) {
        cout << "Base1's construct is called " << i << endl;
    }
};
class Base2 {
public:
    Base2(int j) {
        c]]></description><category></category></item><item><title><![CDATA[结构体的数据对齐]]></title><link>https://blog.youkuaiyun.com/ll_0802/article/details/50709725</link><guid>https://blog.youkuaiyun.com/ll_0802/article/details/50709725</guid><author>ll_0802</author><pubDate>Sun, 21 Feb 2016 22:02:33 +0800</pubDate><description><![CDATA[以32位处理器为例，数据以4字节为对齐单位。
看如下示例代码
#include 
using namespace std;

struct {
    short a1;
    short a2;
    short a3;
}A;
struct {
    long a1;
    short a2;
}B;
class C {
private:
    bool bTemp;
    i]]></description><category></category></item><item><title><![CDATA[C/C++开源项目清单]]></title><link>https://blog.youkuaiyun.com/ll_0802/article/details/50709459</link><guid>https://blog.youkuaiyun.com/ll_0802/article/details/50709459</guid><author>ll_0802</author><pubDate>Sun, 21 Feb 2016 20:55:57 +0800</pubDate><description><![CDATA[1.https://github.com/programthink/opensource
2.http://www.ezlippi.com/blog/2014/12/c-open-project.html]]></description><category></category></item><item><title><![CDATA[virtualbox+Ubuntu网络连接思路]]></title><link>https://blog.youkuaiyun.com/ll_0802/article/details/50709271</link><guid>https://blog.youkuaiyun.com/ll_0802/article/details/50709271</guid><author>ll_0802</author><pubDate>Sun, 21 Feb 2016 20:07:07 +0800</pubDate><description><![CDATA[1.首先ifconfig -a查看Ubuntu的当前网络接口状态
2.如果是网卡设置的问题，输入以下命令修改网卡设置
$sudo vim /etc/network/interfaces


添加网卡，设置动态IP


3.启动网卡
$sudo ifup eth0
关闭命令是sudo ifdown eth0
4.重启网络服务
$sudo service network res]]></description><category></category></item><item><title><![CDATA[关键字const]]></title><link>https://blog.youkuaiyun.com/ll_0802/article/details/50708437</link><guid>https://blog.youkuaiyun.com/ll_0802/article/details/50708437</guid><author>ll_0802</author><pubDate>Sun, 21 Feb 2016 15:56:37 +0800</pubDate><description><![CDATA[1.const与指针
const修饰指针一般有一下4种情况
int b = 500;
const int* a = &b; //(1)
int const *a = &b; //(2)
int* const a = &b; //(3)
const int * const a = &b; //(4)
情况1和2，const都在*的左边，const用来修饰指针所指的变量，即指针指向为常量，不能通过]]></description><category></category></item><item><title><![CDATA[基本语句的综合运用]]></title><link>https://blog.youkuaiyun.com/ll_0802/article/details/50704903</link><guid>https://blog.youkuaiyun.com/ll_0802/article/details/50704903</guid><author>ll_0802</author><pubDate>Sat, 20 Feb 2016 15:31:08 +0800</pubDate><description><![CDATA[int CallScore(int N, int *Score, int *Judge_type) {
    int ret, m, n; //m和n分别是大众评委和专家评委的人数
    ret = m = n = 0;
    double sum1 = 0, sum2 = 0; //sum1和sum2分别代表大众评委和专家评委的分数
    if (N && Score && Judge_]]></description><category></category></item><item><title><![CDATA[a，b交换与比较]]></title><link>https://blog.youkuaiyun.com/ll_0802/article/details/50704744</link><guid>https://blog.youkuaiyun.com/ll_0802/article/details/50704744</guid><author>ll_0802</author><pubDate>Sat, 20 Feb 2016 14:53:15 +0800</pubDate><description><![CDATA[1.有两个变量a、b，不用判断语句，找出其中较大的数

int max = ((a + b) + abs(a - b)) / 2
2.将a，b交换，不用任何中间变量

方法一：加减法（可能会溢出）
a = a + b;
b = a - b;
a = a - b;
方法二：乘除法（可能溢出，b不为0）
a = a * b;
b = a / b;
a = a /b;
方法三：异或法]]></description><category></category></item><item><title><![CDATA[位运算求平均值，防止溢出]]></title><link>https://blog.youkuaiyun.com/ll_0802/article/details/50704080</link><guid>https://blog.youkuaiyun.com/ll_0802/article/details/50704080</guid><author>ll_0802</author><pubDate>Sat, 20 Feb 2016 11:22:49 +0800</pubDate><description><![CDATA[代码段如下：
int f(int x, int y) {
    return (x&y)+((x^y)>>1);
}
二进制数由0,1表示。x和y转换为二进制后，位对应可能有三种形式：分别是1和1对应，1和0对应，0和0对应。因此求平均值也可分成这三种对应情形讨论，然后求和。
1.1和1对应的部分，平均值就是x&y
2.0和0对应的部分，平均值为0
3.1和0对应的部分，平均值是(x^]]></description><category></category></item><item><title><![CDATA[printf从右往左运算]]></title><link>https://blog.youkuaiyun.com/ll_0802/article/details/50700152</link><guid>https://blog.youkuaiyun.com/ll_0802/article/details/50700152</guid><author>ll_0802</author><pubDate>Fri, 19 Feb 2016 20:20:24 +0800</pubDate><description><![CDATA[#include 

void main() {
    int b = 3;
    int arr[] = {6, 7, 8, 9, 10};
    int *ptr = arr;
    *(ptr++) += 123;
    printf("%d %d", *ptr, *(++ptr));
}


最后的输出结果是8,8而不是7,8]]></description><category></category></item><item><title><![CDATA[计算x转化成二进制包含1的数量]]></title><link>https://blog.youkuaiyun.com/ll_0802/article/details/50700101</link><guid>https://blog.youkuaiyun.com/ll_0802/article/details/50700101</guid><author>ll_0802</author><pubDate>Fri, 19 Feb 2016 20:00:25 +0800</pubDate><description><![CDATA[//func返回值是x转化成二进制后包含1的数量
#include 
using namespace std;
int func(int x) {
    int count = 0;
    while (x) {
        ++count;
        x = x&(x-1);
    }
    return count;
}
int main() {
    cout << fu]]></description><category></category></item><item><title><![CDATA[大数据学习相关网站]]></title><link>https://blog.youkuaiyun.com/ll_0802/article/details/50654909</link><guid>https://blog.youkuaiyun.com/ll_0802/article/details/50654909</guid><author>ll_0802</author><pubDate>Fri, 12 Feb 2016 18:04:21 +0800</pubDate><description><![CDATA[1.Hadoop文档
2.Hadoop单机/伪分布式安装教程
3.Hadoop集群安装配置教程
4.林子雨编著《大数据技术原理与应用》教材配套讲义PPT
5.林子雨编著《大数据技术原理与应用》教材配套学习指南
6.林子雨编著《大数据技术原理与应用》教材配套上机练习题目]]></description><category></category></item><item><title><![CDATA[【LEETCODE】String to Integer (atoi)]]></title><link>https://blog.youkuaiyun.com/ll_0802/article/details/50617866</link><guid>https://blog.youkuaiyun.com/ll_0802/article/details/50617866</guid><author>ll_0802</author><pubDate>Mon, 01 Feb 2016 11:57:00 +0800</pubDate><description><![CDATA[class Solution {
public:
    int myAtoi(string str) {
        bool isNeg = false;
        long long ret = 0;
        int i = 0;
        while (isspace(str[i])) ++i; //跳过所有空格
        //如果第一个有效字符既不是正负号也]]></description><category></category></item><item><title><![CDATA[ubuntu安装后的一些配置问题]]></title><link>https://blog.youkuaiyun.com/ll_0802/article/details/39965943</link><guid>https://blog.youkuaiyun.com/ll_0802/article/details/39965943</guid><author>ll_0802</author><pubDate>Fri, 10 Oct 2014 17:37:43 +0800</pubDate><description><![CDATA[因为各种问题安装了很多次Ubuntu，每次都要重新配置，]]></description><category></category></item><item><title><![CDATA[网络编程之UDP简单回射程序]]></title><link>https://blog.youkuaiyun.com/ll_0802/article/details/38560005</link><guid>https://blog.youkuaiyun.com/ll_0802/article/details/38560005</guid><author>ll_0802</author><pubDate>Thu, 14 Aug 2014 16:10:01 +0800</pubDate><description><![CDATA[服务器程序serv02.c]]></description><category></category></item></channel></rss>