房收费系统的时候,令人相当恶心的一件事就是判断文本框和组合框是否为空还有清空文本框。基本上每个窗体都要进行判断,那一个接着一个的If...Else...语句,长长一串,看着就头疼,但是第一次做机房收费系统的时候竟然傻傻的一个不落都写了出来。真佩服当时的自己,不过这一次还是不要在做那种傻事了,因为我们经历了不少面向对象的洗礼,认识了封装。
向对象的范畴里,对于相同的或者类似的代码...
分类:
Web程序 时间:
2014-06-20 13:13:04
阅读次数:
427
上学期数据结构课上写的一个二叉树类,贴出来,写得不是太好,欢迎高手指点。
struct BiNode//定义节点类型
{
char data;
BiNode *lchild;
BiNode *rchild;
};
class BiTree
{
private:
BiNode *root;
public:
BiTree()
{
root=NULL;
}
~BiT...
分类:
其他好文 时间:
2014-06-20 11:19:10
阅读次数:
193
Enumerations and Structures
Enumerations 枚举的使用
使用 enum 定义一个枚举,枚举里面可以关联方法,比如下文中的描述方法
enum Rank: Int {
case Ace = 1
case Two, Three, Four, Five, Six, Seven, Eight, Nine, Ten
case Ja...
分类:
其他好文 时间:
2014-06-20 09:03:39
阅读次数:
322
#include#include#define MAX_VERTEX_NUM 20 typedef
struct ArcBox{ int tailvex,headvex;//该弧的头和尾定点的位置 struct ArcBox
*hlink,*tlink;//分别为弧头和弧尾相同的弧的链域 int *...
分类:
其他好文 时间:
2014-06-12 00:13:49
阅读次数:
243
【题目】
Given a binary tree
struct TreeLinkNode {
TreeLinkNode *left;
TreeLinkNode *right;
TreeLinkNode *next;
}
Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be...
分类:
其他好文 时间:
2014-06-07 14:28:36
阅读次数:
215
关于结构体的一个特殊用法
//写法一
struct array {
int count;
char *buf;
}
//写法二
struct array {
int count;
char buf[0];
}
如果一个buf用作一个buffer的话,这时候如果malloc一块内存,
用方法一,buf是指针的话,指向这块申请出的内存的话,这里arr...
分类:
其他好文 时间:
2014-06-07 12:13:20
阅读次数:
273
题目链接判断一颗二叉树是否是二叉搜索树(二叉排序树),也就是BST如果该二叉树是BST, 那么对其中序遍历,所得序列一定是单调递增的(不考虑有重复数值的情况)附上代码:
1 /** 2 * Definition for binary tree 3 * struct TreeNode { 4 *...
分类:
其他好文 时间:
2014-06-07 11:28:18
阅读次数:
254
在MFC中增加一个时间计时器消息事件利用this->SetTimer(1,1000,NULL);开启计时器添加响应事件void
Csqllink1Dlg::OnTimer(UINT_PTR nIDEvent) { CTime
tm; tm=CTime::GetCurrentTime(); CWnd*...
分类:
其他好文 时间:
2014-06-07 09:58:30
阅读次数:
224
从sdk3.2.5升级到sdk
7.1中间废弃了很多的方法,还有一些逻辑关系更加严谨了。1,警告:“xoxoxoxo” is
deprecated解决办法:查看xoxoxoxo的这个方法的文档,替换掉这个方法即可。2,警告:Declaration of "struct
sockaddr" will ...
分类:
其他好文 时间:
2014-06-07 07:43:40
阅读次数:
204
#include#include#define MAXSIZE 20typedef char
TEelemtype;typedef struct BiTNode{TEelemtype data;struct BiTNode
*lchild,*rchild;}BiTNode,*BiTree;//队列....
分类:
其他好文 时间:
2014-06-05 13:25:12
阅读次数:
377