
C++
文章平均质量分 60
zongshiwujie
这个作者很懒,什么都没留下…
展开
-
在XP/WIN7系统下使用Codeblocks与MinGW编译VTK
下载最新版本的Codeblocks+MinGW.exe,CMake.exe,vtk.zip和vtkdata.zipCodeblocks+MinGW10.05.exe Cmake-2.8.3-win32-x86.exe Vtk-5.6.1.zip Vtkdata-5.6.1.zip 在根目录下建C:/VTK,新建vtkSource和vtkData文件夹(不能有空格),将vtk源码原创 2012-03-20 10:49:41 · 2600 阅读 · 5 评论 -
C++ 结合 Boost:40行代码读写和处理 txt 文件
C++ 结合 Boost:40行代码读写和处理 txt 文件#include #include #include #include #include using namespace std;using namespace boost;int main (){ string stringLine; ifstream infile; vector temp原创 2012-03-30 17:22:22 · 7232 阅读 · 0 评论 -
Using SQLite in C++ with Code::blocks
What you will need:-Basic C++ and SQL knowledge-SQLite (Download)IntroductionSQLite is an embedded SQL database engine. Unlike most other SQL databases, SQLite does not have a separate ser转载 2012-03-19 12:07:02 · 1953 阅读 · 0 评论 -
C/C++ 遍历文件夹下的文件名(不含子目录)
#include using namespace std;int main(){ system("dir F:\\指定文件夹 /B >filelist.txt");}把文件名保存在“filelist.txt”中。http://zhidao.baidu.com/question/54600009转载 2012-06-12 11:52:36 · 1259 阅读 · 0 评论 -
C/C++ 遍历文件夹下的文件名(含子目录)
#include#includeusing namespace std;int main(){ _finddata_t file; long lf; //修改这里选择路径和要查找的文件类型 if((lf = _findfirst("F:\\2011Experiment\\*.*",&file))==-1l)转载 2012-06-12 12:04:08 · 2086 阅读 · 1 评论 -
C++ Code::Blocks + MinGW 配置 OpenMP 和例子
http://forums.codeblocks.org/index.php?topic=13104.0 配置OpenMP:1. "Settings -> Compiler and debugger setting-> Compiler settings-> Other options", 加入"-fopenmp” 2. "Settings -> Compiler and翻译 2013-05-20 21:14:02 · 2320 阅读 · 0 评论 -
对比sqlite3_exec 和sqlite3_bind 插入100万行数据的速度 with BEGIN TRANSACTION using C++ and SQLite
使用sqlite3_exec 插入100万行数据需要 27 s,而使用sqlite3_bind_double 插入100万行数据只需要3.7 s。主要是因为采用sqlite3_exec(),相当于每插入一行数据同时用到sqlite3_prepare_v2(), sqlite3_step() 和 sqlite3_finalize(),另外需要把double 强制转换成 string 然后再转换成原创 2012-03-26 11:06:08 · 6216 阅读 · 1 评论 -
在给定范围中取不重复的随机数
在给定范围中取不重复的随机数 随机取m个数(在1到n的范围之内),(m,要求m个数没有重复。有没有什么好的算法,时间复杂度和空间复杂度都很好?方法一:用STL中的set集,红黑树来处理取随机数可以用C++标准的rand,至于M个不重复,用std::set来解决,把取到的随机数插入到set里面,通过set的size()==m来判断是否已取够m个了。#include转载 2013-06-25 11:42:15 · 1192 阅读 · 0 评论