定义文件状态枚举:0-路径为空,1-存在文件,2-路径不为空,但文件不存在 public
enum FileExsitStatus { NoPath=0, FileExsit=1, NoFile=2 }利用File文件操作类判断文件是否存在:
/...
分类:
其他好文 时间:
2014-05-24 05:43:08
阅读次数:
226
//for 反汇编#includeint main(){ int i=0; int s=0;
for(i=10;i=1;i--) { s=s+1; } return 0;}//for 反汇编#includeint
main(){000000013F1...
分类:
其他好文 时间:
2014-05-23 12:41:04
阅读次数:
434
题目链接题意:给出单链表头指针,要求交换链表中每一对相邻的结点.注意:不可以改变链表中结点的值,只可以使用常量空间.附上代码:
1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int
val;...
分类:
其他好文 时间:
2014-05-23 10:43:49
阅读次数:
249
#include
#include
#include
#include
#include
using namespace std;
struct Library
{
long number;//编号
string bookname;//书名
string author;//作者
string press;//出版社
int price;//价格
}...
分类:
其他好文 时间:
2014-05-22 07:17:38
阅读次数:
206
struct dx_rootHtree的内部节点:struct
dx_nodeHtree树根和节点中都存在的Hash map:struct
dx_entry1.20扩展属性EA扩展属性(xattrs)通常存储在磁盘上的一个单独的数据块中,通过inode.i_file_acl*引用。扩展属性的第一应用...
分类:
其他好文 时间:
2014-05-20 11:07:57
阅读次数:
675
题目:从上往下打印出二叉树的每个节点,同一层的节点按照从左到右的顺序打印。分析:其实就是按层的遍历方式#include #include using
namespace std;struct BinaryTree{ int data; BinaryTree* lchild; Bin...
分类:
其他好文 时间:
2014-05-20 10:13:47
阅读次数:
242
//#define LOCAL#include#include#include#includeint
const MAX_N=101;typedef struct Point{ int x,y; bool operatorVec[i].y) { ...
分类:
其他好文 时间:
2014-05-19 17:08:45
阅读次数:
253
最近写代码,无意中发现了一个坑,关于自定义比较函数的stl
sort函数的坑,于是记录下来。先贴代码: 1 #include 2 #include 3 #include 4 5 struct finder 6 { 7
bool operator()(int first, in...
分类:
其他好文 时间:
2014-05-19 14:47:48
阅读次数:
319
对齐规律:占用最大成员类型的整数倍,每个成员的对齐地址为该成员类型的整数倍struct{
int a; 0-3char b;4-5 int
c;8-11}:12含位域:使用位域的主要目的是压缩存储,其大致规则为:1)如果相邻位域字段的类型相同,且其位宽之和小于类型的sizeof大小,则后面的字段将....
分类:
其他好文 时间:
2014-05-19 14:15:02
阅读次数:
204
出题:输入一个单向链表,要求输出链表中倒数第K个节点分析:利用等差指针,指针A先行K步,然后指针B从链表头与A同步前进,当A到达链表尾时B指向的节点就是倒数第K个节点;解题:
1 struct Node { 2 int v; 3 Node *next; 4 }; 5 ...
分类:
其他好文 时间:
2014-05-19 12:07:16
阅读次数:
376