随笔分类 -  c/c++

vs2010 链接OpenCV 静态库
摘要:1. 添加opencv 头文件路径 Properties-> VC++ Directories -> Include Directories += $(OPENCV_INC)2. runtime library 由dll改为非dll Properties-> c/c++ / Code Genera... 阅读全文

posted @ 2015-08-13 11:57 VincentEcho 阅读(577) 评论(0) 推荐(0)

android开发:jni下native代码获取毫秒级时间
摘要:#include #define LOG_TAG ""#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)struct timeval xTime;int xRet = gettimeofday(... 阅读全文

posted @ 2015-01-27 17:26 VincentEcho 阅读(5660) 评论(1) 推荐(0)

二分查找binarySearch
摘要:1 #include 2 #include 3 #include 4 5 #define ARRAY_SIZE 10 6 7 int binarySearch(int *arr, int size, int target) 8 { 9 int low = 0;10 in... 阅读全文

posted @ 2015-01-06 14:55 VincentEcho 阅读(127) 评论(0) 推荐(0)

快速排序quicksort实现方法
摘要:1 #include 2 #include 3 4 #define ARRAY_SIZE 10 5 6 void swap(int *x, int *y) 7 { 8 int a = *x; 9 *x = *y;10 *y = a;11 }12 13 int ran... 阅读全文

posted @ 2015-01-06 14:34 VincentEcho 阅读(293) 评论(0) 推荐(0)

windows 下遍历文件夹
摘要:1 void reversedir(string srcDir) 2 { 3 struct _finddata_t filefind; 4 string imgName = srcDir + "\\*.*"; 5 int done=0, handle; 6 7 ... 阅读全文

posted @ 2014-11-26 09:58 VincentEcho 阅读(217) 评论(0) 推荐(0)

Luhn 算法-- 信用卡号码的校验
摘要:信用卡号码的校验用的是Luhn算法: 旧IBM的工程师Hans Peter Luhn在1954年发明的。当时被申请为专利,现在已经公开,进入公共知识领域,成为国际标准组织的一项标准: ISO/EC 7812-1。从卡号最后一位数字开始,逆向将奇数位数字相加求和从卡号最后一位数字开始,逆向将偶数位数字... 阅读全文

posted @ 2014-11-18 16:08 VincentEcho 阅读(1034) 评论(0) 推荐(0)

导航