TODO

在C++中使用引用类型的成员变量

http://blog.163.com/software_seven/blog/static/1819313902011212842752/

sublime text 使用代理

https://sublime.wbond.net/installation

http://www.cnblogs.com/Sunwayking/articles/2990376.html
http://blog.csdn.net/arbel/article/details/6939078


Source insight 3.5,怎么双击选中一个变量后怎么高亮选中的变量.

http://zhidao.baidu.com/link?url=k5WsxZuFvdENbeLcNuLyXN8WRgCgf7MVlkvtAFqFWlQsqZlxSv1ApHiOOwwEuGIw0sbEdAWSaN9u8dpxe6Tbgq

shell脚本中的$*,$@和$#


http://zhidao.baidu.com/link?url=b1HDneIcTlOQ7HF6cF6YbGN0EpfK7cyDNqQFtGnQ3QZ3o14cmnhrd8hYhTKXaD15YK66v6w3c_d9LH6S2drsPK

$@--目标文件,$^--所有的依赖文件,$<--第一个依赖文件。


makefile编译所有cpp文件

MYSQL=/usr/local/mysql

CC=g++
CFLAG=-g -O -fpermissive
INCLUDE=-I$(MYSQL)/include/mysql
LIBDIR=-L$(MYSQL)/lib/mysql
LIB=-lmysqlclient -lz -lm -lbz2

DEFINE=-DDEBUG
target=run
src=$(wildcard *.cpp *.c)
obj=$(patsubst %.cpp, %.o, $(src))

all: $(target)
$(obj): $(src)
    $(CC) -c $(DEFINE) $(CFLAG) -o $@ $^ $(INCLUDE)
$(target):$(obj)
    $(CC) -o $@ $^ $(LIBDIR) $(LIB)
clean:
    rm -f $(obj) $(target)


mysql的c api 简单用法


http://www.cnblogs.com/linbc/archive/2009/06/15/1503924.html




#include <iostream>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include "mysql.h"
using namespace std;
int main(int argc, char* argv[])
{
        // get mysql server arguments
        MYSQL * mysql = (MYSQL*)malloc(sizeof(MYSQL));

        memset(mysql, 0, sizeof(MYSQL));

        if (NULL == mysql_init(mysql))
        {
                printf("%s\n", mysql_errno(mysql));
                return 1;
        }


        mysql_options(mysql, MYSQL_SET_CHARSET_NAME, "latin1");

        if (!mysql_real_connect(mysql, "172.23.150.211", "root", "first2012++", "c2c_report", 0, NULL, 0))
        {
                printf("%s\n", mysql_error(mysql));
                return 1;
        }

        if (mysql) free(mysql);
        return 0;
}

#include <iostream>
#include <iconv.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <iostream>
using namespace std;
int main()
{
    char name[20]="luodingjia";
    iconv_t cd = iconv_open("gb2312", "utf8");
    if ((iconv_t)(-1) == cd)
    {
        perror("iconv_open error\n");
        return -1;    
    }

    char buf[1024] = {0};
    char * psrc = name, *pdst = buf;
    size_t isrc = strlen(name);
    size_t idst = 1024;
    cout<<isrc<<endl;
    size_t ret = iconv(cd, &psrc, &isrc, &pdst, &idst);
    if ((size_t)(-1) == ret)
    {
        perror("iconv error\n");
        printf("%d", errno);
        return -1;
    }
    cout<<name<<endl;
    cout<<isrc<<endl;
    cout<<buf<<endl;
    cout<<idst<<endl;
    cout<<strlen(buf)<<endl;
    iconv_close(cd);
    return 0;
}


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值