C++
zhangla1220
这个作者很懒,什么都没留下…
展开
-
x64下vs2013 C++遍历目录下所有文件使用_findnext()调试时中断
使用findfirst findnext遍历文件时,发生访问冲突错误 错误定位到ntdll.dll代码为:void getFiles(string path, vector& files)//lxk20160302{ //文件句柄 long hFile = 0; //文件信息 struct _finddata_t fileinfo; string p; cout << pat转载 2016-08-25 10:09:24 · 3629 阅读 · 4 评论 -
LInux vim 显示行号
LInux vim 显示行号原创 2016-03-11 09:57:32 · 696 阅读 · 0 评论 -
MFC 实现对话框最大化
MFC 实现对话框最大化原创 2016-03-10 12:40:17 · 979 阅读 · 0 评论 -
gcc/g++ 出现.../crt1.o: In function `_start': (.text+0x18): undefined reference to `main'的错误
gcc/g++ 出现.../crt1.o: In function `_start': (.text+0x18): undefined reference to `main'的错误原创 2016-03-08 16:08:14 · 24741 阅读 · 4 评论 -
linux下多个cpp文件的Makefile编译
linux下多个cpp文件的Makefile编译原创 2016-03-24 16:49:09 · 7496 阅读 · 0 评论 -
caffe cudnn出现错误: declaration is incompatible with "const char *cudnnGetErrorString(cudnnStatus_t)"
caffe cudnn出现错误: declaration is incompatible with "const char *cudnnGetErrorString(cudnnStatus_t)"原创 2016-03-31 13:56:26 · 3665 阅读 · 0 评论 -
计算时间
clock_t startTime = clock();...clock_t medTime = clock(); double convertTime = static_cast(medTime - startTime)/CLOCKS_PER_SEC*1000;printf("Time:%f\n", convertTime);原创 2015-01-13 09:30:48 · 655 阅读 · 0 评论 -
ZigZag Conversion-LeetCode
The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)P A H NA P L S I原创 2014-11-02 15:34:59 · 534 阅读 · 0 评论 -
Maximum Depth of Binary Tree - LeetCode
Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node./** * Definition for binary tree *原创 2014-11-02 14:15:50 · 424 阅读 · 0 评论 -
Remove Duplicates from Sorted List -LeetCode
Given a sorted linked list, delete all duplicates such that each element appear only once.For example,Given 1->1->2, return 1->2.Given 1->1->2->3->3, return 1->2->3./** * Definition for si原创 2014-11-03 14:16:35 · 362 阅读 · 0 评论 -
Same Tree - LeetCode
Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical and the nodes have the same value.这道题感觉不难 做出来后每次原创 2014-11-02 16:50:41 · 440 阅读 · 0 评论 -
Remove Duplicates from Sorted Array-LeetCode
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must do this in place with c原创 2014-11-03 14:32:58 · 363 阅读 · 0 评论 -
VS2008提示无法打开包括文件:“afxcontrolbars.h”解决办法
VS2008提示无法打开包括文件:“afxcontrolbars.h”解决办法原创 2016-03-14 09:32:28 · 408 阅读 · 0 评论 -
Linux g++编译 so文件出错:file not recognized: File trunccated
Linux g++编译 so文件出错:file not recognized: File trunccated原创 2016-03-14 11:12:16 · 5022 阅读 · 0 评论 -
caffe proto.exe生成caffe.pb.h和caffe.pb.cc文件
cmd打开windows下命令行,将proto.exe和运行时所使用的dll与caffe.proto放置在同一文件夹下命令行打开至该文件夹下则输入命令:protoc caffe.proto --cpp_out=./运行完毕,文件已生成原创 2016-09-02 16:16:36 · 5422 阅读 · 0 评论 -
Linux查看CPU信息的.sh文件
Linux查看CPU信息的.sh文件转载 2016-08-18 14:30:06 · 1240 阅读 · 0 评论 -
.sh文件中的首行 #!/bin/bash 以及 bad interpreter: Text file busy 文本文件忙错误
#!/bin/bash#! /bin/bash 是指此脚本使用,/bin/bash来解释执行,#!是特殊的表示符,其后面根的是此解释此脚本的shell的路径。原创 2016-08-18 14:17:06 · 13928 阅读 · 0 评论 -
nohup命令 后台运行
后台运行命令:nohup Command [ Arg ... ] [ & ]如果使用nohup命令提交作业,那么在缺省情况下该作业的所有输出都被重定向到一个名为nohup.out的文件中,除非另外指定了输出文件:nohup command > myout.file 2>&1 &其中:0 – stdin (standard input),1 – stdout原创 2016-08-16 15:14:45 · 649 阅读 · 0 评论 -
动态库与静态库优缺点比较
转载原文:http://blog.csdn.net/sunshinewave/article/details/39155755 我们在编写一个C语言程序的时候,经常会遇到好多重复或常用的部分,如果每次都重新编写固然是可以的,不过那样会大大降低工作效率,并且影响代码的可读性,更不利于后期的代码维护。我们可以把他们制作成相应的功能函数,使用时直接调用就会很方便,还可以进行后期的转载 2016-07-28 11:31:17 · 338 阅读 · 0 评论 -
GCC 64位程序的makefile条件编译心得——32位版与64位版、debug版与release版(兼容MinGW、TDM-GCC)
原文地址 http://www.cnblogs.com/zyl910/archive/2012/08/14/gcc64_make.html为了适应现在越来越流行的64位系统,经常需要将代码分别编译为32位版和64位版。其次,除了需要生成debug版用于开发测试外,还需要生成release版用于发布。本文介绍了如何利用makefile条件编译来生成这些版本,而且不仅兼容Linux下的GC转载 2016-07-28 11:03:29 · 1401 阅读 · 0 评论 -
jni运行错误 symbol lookup error
jni运行错误 symbol lookup error原创 2016-06-12 11:25:35 · 3644 阅读 · 0 评论 -
caffe中关闭命令行的log输出
caffe中关闭命令行的log输出原创 2016-03-28 16:46:29 · 11219 阅读 · 2 评论 -
Linux opencv Cmake无界面更改配置的方法
Linux opencv Cmake无界面更改配置的方法原创 2016-03-25 15:16:22 · 1588 阅读 · 0 评论 -
linux下部分常用命令
linux下部分常用命令原创 2016-03-25 13:30:37 · 621 阅读 · 0 评论 -
去除VS中汉字拼写检查后留下的红色波浪线
去除VS中汉字拼写检查后留下的红色波浪线原创 2016-04-07 09:49:26 · 624 阅读 · 0 评论 -
Valid Parentheses- LeetCode
Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The brackets must close in the correct order, "()" and "()[]{}" are all vali原创 2014-11-03 10:33:28 · 411 阅读 · 0 评论 -
Binary Tree Level Order Traversal II-LeetCode
Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).For example:Given binary tree {3,9,20,#,#,15,7},原创 2014-11-02 13:55:06 · 407 阅读 · 0 评论 -
Valid Palindrome -LeetCode
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: Panama" is a palindrome."race a car" is not a原创 2014-10-27 13:56:07 · 411 阅读 · 0 评论 -
Symmetric Tree-LeetCode
struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(NULL) {}};bool issame(TreeNode *root1, TreeNode *root2){ if (root1 == NULL && ro原创 2014-10-22 16:25:31 · 423 阅读 · 0 评论 -
Pascal's Triangle - LeetCode
Given numRows, generate the first numRows of Pascal's triangle.For example, given numRows = 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1]]class Solution {public原创 2014-10-27 18:43:01 · 463 阅读 · 0 评论 -
C++中string erase函数的使用(转载)
原文地址:http://www.cnblogs.com/ylwn817/articles/1967689.htmlerase函数的原型如下:(1)string& erase ( size_t pos = 0, size_t n = npos );(2)iterator erase ( iterator position );(3)iterator erase ( itera转载 2014-09-03 20:45:19 · 509 阅读 · 0 评论 -
使用USES_CONVERSION出现stack overflow错误
使用USES_CONVERSION时,当调用次数频繁过多时,出现stack overflow错误查过fa转载 2014-09-03 14:53:32 · 957 阅读 · 0 评论 -
c++中通过文件名称获取文件后缀
c++中通过文件名称获取文件路径:即从尾部找到第一个“.”右侧的字符串即为其后缀:string suffixStr = filename.substr(filename.find_last_of('.') + 1);//获取文件后缀原创 2014-09-03 15:28:07 · 14219 阅读 · 0 评论 -
字符之间的转化
nicode下字符经常需要转化,还是比较麻烦的。但是Unicode支持跨平台 而且系统内部也使用Unicode 因此我们一般仍需要使用该编码方式。原创 2014-09-14 16:11:45 · 644 阅读 · 0 评论 -
C++下Berkeley DB的配置和简单应用
1.下载Berkeley DB 12cR1 6.0.20 http://www.oracle.com/technetwork/cn/database/database-technologies/berkeleydb/downloads/index.html原创 2014-07-27 10:07:56 · 3280 阅读 · 0 评论 -
Unicode下 获取当前工作路径并存入char*
之前在网上找了很多 但总存在原创 2014-07-26 11:26:14 · 1487 阅读 · 0 评论 -
C++获取文件夹下所有文件名称的三种方式
1 string imglist_file = "test_result\\imglist.txt";//存储文件名称列表,改为全局变量 string temp_imgname; string dir_command("dir "); dir_command += ImageSet + "/b > " + imglist_file; ifstream file(原创 2014-07-26 11:06:23 · 5462 阅读 · 0 评论 -
Vector的自动排序Sort
建立了一个结构体,然后用容器进行存放,想对其进行排序。方法如下:1.包含原创 2014-07-22 17:13:05 · 6080 阅读 · 0 评论 -
Path Sum - LeetCode
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.For example:Given the below binary tree and sum原创 2014-10-28 11:25:48 · 423 阅读 · 0 评论 -
Minimum Depth of Binary Tree - LeetCode
Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node./** * Definition for binary tree *原创 2014-10-28 14:31:25 · 503 阅读 · 0 评论