编程小样
readzw
这个作者很懒,什么都没留下…
展开
-
c++ 产生随机数
应包含的头文件#include #include //用时间作随机数种子几个主要的函数:randomize() ;//启动随机数生成器rand(); //生成一个0~RAND_MAX(32767)之间的随机数int random(int N);// 产生0~N-1之间的随机数srand(unsigned int seed); //以se原创 2012-08-20 14:55:29 · 680 阅读 · 0 评论 -
【转】OpenCV读取MP4,mpeg, wmv, flv, mov, 3gp etc. on Win32
来源:http://wsyjwps1983.blog.163.com/blog/static/6800900120123181500785/ fily的日志 - 网易博客2012-04-18 13:50:00| 分类: 图像与视频编解码|字号 订阅2011-09-转载 2012-10-29 11:28:02 · 13614 阅读 · 0 评论 -
c++记时代码
经常测试代码的运行耗时,以下代码可以实现1. clock()方法,该方法时间精度为毫秒。#include #include using namespace std;int _tmain(int argc, _TCHAR* argv[]){clock_t startTime,endTime;startTime = clock();{***};endTime =原创 2012-08-20 14:19:49 · 911 阅读 · 1 评论 -
std::nth_element 排序
template inline void nth_element(_RanIt _First, _RanIt _Nth, _RanIt _Last, _Pr _Pred)template inline void nth_element(_RanIt _First, _RanIt _Nth, _RanIt _Last)该函数的作用为将迭代器指向的从_First 到 _last 之间原创 2013-04-01 13:59:24 · 8894 阅读 · 0 评论 -
vc++遍历文件
应包含的头文件:#include 1. 遍历文件夹下的文件(不包括子文件夹)例如查找全部jpg图片,fileName为 [folderPath]\\*.jpg int fileCount=0; _finddata_t fileInfo; long handle = _findfirst(fileName, &fileInfo); if (handle原创 2013-10-15 15:01:06 · 4102 阅读 · 0 评论