长路漫漫

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2015年3月27日

摘要: 说明:(1)转载请注明出处:http://www.cnblogs.com/opangle/p/4298155.html(2)以下以VS2013为例,并假设VC安装路径为%VC_INSTALL_PATH%(本人的安装目录为D:\Program Files (x86)\Microsoft Visual ... 阅读全文
posted @ 2015-03-27 14:14 opangle 阅读(2663) 评论(0) 推荐(3) 编辑

2014年11月8日

摘要: 在使用putty、secureCRT、XShell等终端仿真器连接linux系统时,ls、vim等工具的输出都含有各种颜色,这些颜色的输出大大地增强了文本的可读性。一、终端文本颜色输出的一般示例在bash中,通常我们可以使用echo命令加-e选项输出各种颜色的文本,例如:echo -e "\033[... 阅读全文
posted @ 2014-11-08 09:50 opangle 阅读(11402) 评论(2) 推荐(8) 编辑

2013年6月13日

摘要: There are two different forms of the extern "C" declaration: extern "C" as used above, and extern "C" { … } with the declarations between the braces. The first (inline) form is a declaration with extern linkage and with C language linkage; the second only affects langua 阅读全文
posted @ 2013-06-13 10:06 opangle 阅读(372) 评论(0) 推荐(0) 编辑

2013年5月8日

摘要: SQLite是一种轻量级的开源数据库,其源代码可从www.sqlite.org获取,由于其源代码是C语言实现的,因此它提供的接口可以很简单地被C/C++程序使用。Java程序中如何使用它呢?本人初学Java,暂时也不了解Java程序如何调用C/C++库,但目前了解到两种方法:(1)使用SQLite JDBC,这个使用很方便,只需要下载个jar包即可,缺点就是慢一点;(2)使用SQLite Java Wrapper,这个据说需要安装本地库,比如windows下需要相应的dll文件,linux下需要相应的.so文件。本人试过第(1)中方法,下面的例子只针对第(1)种方法,第(2)种方法留待以后深入 阅读全文
posted @ 2013-05-08 11:43 opangle 阅读(4933) 评论(0) 推荐(0) 编辑

2013年4月25日

摘要: 1、sqlite3_open系列函数:int sqlite3_open( const char *filename, /* Database filename (UTF-8) */ sqlite3 **ppDb /* OUT: SQLite db handle */);int sqlite3_open16( const void *filename, /* Database filename (UTF-16) */ sqlite3 **ppDb /* OUT: SQLite db handle */);int sqlite3_open_v2(... 阅读全文
posted @ 2013-04-25 18:18 opangle 阅读(516) 评论(0) 推荐(0) 编辑

2013年1月1日

摘要: 系统平台:Red-Hat-Enterprise-Linux-Server-6.0-X86_641、clang-3.2安装笔记(1)下载clang、llvm、compiler-rt源代码 LLVM-3.2源代码下载:LLVM source code(12M) clang-3.2源代码下载:Clang source code(8.4M) compiler-rt源代码下载:Compiler RT source code(1.4M)clang-3.2.src.tar.gzcompiler-rt-3.2.src.tar.gzllvm-3.2.src.tar.gz(2)解压下载的源代码压缩包tar ... 阅读全文
posted @ 2013-01-01 14:31 opangle 阅读(5003) 评论(2) 推荐(0) 编辑

2012年11月19日

摘要: 1、右值引用引入的背景临时对象的产生和拷贝所带来的效率折损,一直是C++所为人诟病的问题。但是C++标准允许编译器对于临时对象的产生具有完全的自由度,从而发展出了Copy Elision、RVO(包括NRVO)等编译器优化技术,它们可以防止某些情况下临时对象产生和拷贝。下面简单地介绍一下Copy Elision、RVO,对此不感兴趣的可以直接跳过:(1) Copy ElisionCopy Elision技术是为了防止某些不必要的临时对象产生和拷贝,例如:struct A { A(int) {} A(const A &) {}};A a = 42;理论上讲,上述A a = 42;语句.. 阅读全文
posted @ 2012-11-19 13:41 opangle 阅读(6413) 评论(9) 推荐(7) 编辑

2012年8月27日

摘要: 《Itanium C++ ABI》文档2.3节中描述:A pointer to data member is an offset from the base address of the class object containing it, represented as a ptrdiff_t. It has the size and alignment attributes of a ptrdiff_t. A NULL pointer is represented as -1.测试一:// test.cpp#include <iostream>#define PRINT(var 阅读全文
posted @ 2012-08-27 13:31 opangle 阅读(339) 评论(0) 推荐(0) 编辑

2012年8月24日

摘要: 先看一个例子:#!/bin/bashfun1(){ $1 if [ $? -ne 0 ] then echo Failed executing $1 exit 1 fi}fun2(){ echo $1# return 0 or 1}fun1 "fun2 \"that is right\""输出结果为:"that我们期待的结果应该为:that is right为什么会这样呢?实际上,例子中实际调用fun1()时,$1为fun2 \"that is right\",因此fun2()中的$1就成了"that。使用eval 阅读全文
posted @ 2012-08-24 11:05 opangle 阅读(2124) 评论(0) 推荐(0) 编辑

2012年8月22日

摘要: 先看一个例子,假设有三个文件:headerA.h、headerB.h、main.cpp,其内容分别如下:// file: headerA.hstruct foo{ int member;};// file: headerB.h#include "headerA.h"// file: main.cpp#include "headerA.h"#include "headerB.h"int main(){ return 0;}其中main.cpp中直接包含了headerA.h头文件,而headerB.h中又再次包含了headerA.h,这使 阅读全文
posted @ 2012-08-22 14:39 opangle 阅读(2828) 评论(1) 推荐(0) 编辑