2009年11月5日

如何判断某键的是否按下

摘要: 判断某键是否按下,应使用WINAPI的GetKeyState函数。MSDN给出这样的解释: The GetKeyState function retrieves the status of the specified virtual key. The status specifies whether the key is up, down, or toggled (on, off—alterna... 阅读全文

posted @ 2009-11-05 23:25 中道学友 阅读(1947) 评论(0) 推荐(0) 编辑

CToolTipCtrl的使用实例-MSDN

摘要: 如何操纵CToolTipCtrl来给自己的控件添加tool tip呢?MSDN给出了答案。   创建并操纵一个CToolTipCtrl ======================= 创建一个CToolTipCtrl的对象. 调用Create函数来创建windows通用提示控件并使之与CToolTipCtrl对象产生关联。 调用AddTool函数来把tool tip control... 阅读全文

posted @ 2009-11-05 23:20 中道学友 阅读(5612) 评论(0) 推荐(0) 编辑

面试题目- 到底有几条病狗

摘要: 题目:     村子里有50个人,每人有一条狗。在这50条狗中有病狗(这种病不会传染)。于是人们就要找出病狗。每个人可以观察其他的49条狗,以判断它们是否生病,只有自己的狗不能看。观察后得到的结果不得交流,也不能通知病狗的主人。主人一旦推算出自己家的是病狗就要枪毙自己的狗,而且每个人只有权利枪毙自己的狗,没有权利打死其他人的狗。第一天,第二天都没有枪响。到了第三天传来... 阅读全文

posted @ 2009-11-05 23:16 中道学友 阅读(2378) 评论(0) 推荐(0) 编辑

[转] BSTR、char*和CString转换

摘要: (1) char*转换成CString 若将char*转换成CString,除了直接赋值外,还可使用CString::Format进行。例如: char chArray[] = "This is a test"; char * p = "This is a test"; 或 LPSTR p = "This is a test"; 或在已定... 阅读全文

posted @ 2009-11-05 23:14 中道学友 阅读(328) 评论(0) 推荐(0) 编辑

[转]关于Debug和Release之本质区别的讨论

摘要: 经常在 CSDN 上看见有人问 Debug 运行正常但 Release 失败的问题。以往的讨论往往是 经验性的,并没有指出会这样的真正原因是什么,要想找出真正的原因通常要凭运气。最 近我看了一些这方面的书,又参考了 CSDN 上的一些帖子,然后深入研究了一下关于二者 的不同。以下是我的一些体会,拿来与大家共享。 -------------------------------------- 本文主要... 阅读全文

posted @ 2009-11-05 23:12 中道学友 阅读(5498) 评论(0) 推荐(0) 编辑

C语言运算符的优先级表与结合性要点

摘要: 表达式 优先级 ()(小括号) [](数组下标) .(结构成员) ->(指针型结构成员) ↑最高 !(逻辑非) .(位取反) -(负号) ++(加1) --(减1) &(变量地址)   │ *(指针所指内容)  type(函数说明)  sizeof(长度计算)  │ *(乘)     /(除) ... 阅读全文

posted @ 2009-11-05 23:02 中道学友 阅读(2210) 评论(0) 推荐(0) 编辑

编程练习-反转链表

摘要: Code Snippet #include <iostream> #define Reverse2 using namespace std; struct linka{     int data;     linka* next; }; void reverse(linka* &head) ... 阅读全文

posted @ 2009-11-05 22:46 中道学友 阅读(280) 评论(0) 推荐(0) 编辑

编程练习- 尝试写出String类的成员函数实现

摘要: #include <string.h>//***题目部分************************************class String{public: String(const char *str = NULL); String(const String &another); ~ String(); String & operator =(const ... 阅读全文

posted @ 2009-11-05 22:42 中道学友 阅读(979) 评论(0) 推荐(0) 编辑

编程练习-自己写一个strcpy

摘要: char *strcpy_(char *strDest, const char *strSrc){ // Error if(strSrc == NULL) return NULL; const char* p = strSrc;//const在?*号左边,指针可以变,所指物不能变! char* q = strDest; p = strSrc; q = strDest; while(*p != '\... 阅读全文

posted @ 2009-11-05 22:34 中道学友 阅读(513) 评论(0) 推荐(0) 编辑

编程练习- 链表题目-反序,合并

摘要: Code Snippet #include <iostream> #include<fstream> using namespace std; struct Node {         int data ;        ... 阅读全文

posted @ 2009-11-05 22:30 中道学友 阅读(351) 评论(0) 推荐(0) 编辑

编程练习- 找第二大的数

摘要: Code Snippet #include <iostream> #include <fstream> using namespace std; int main() ...{     ifstream inFile("d:\intArray.txt");     ... 阅读全文

posted @ 2009-11-05 22:25 中道学友 阅读(390) 评论(0) 推荐(0) 编辑

导航

技术追求准确,态度积极向上