摘要: 先在资源中插入menu资源,然后在类向导中添加OnContestMenu(CWnd* pWnd,CPoint point)函数代码很短如下: 1 void CMyDlg::OnContestMenu(CWnd* pWnd,CPoint point) 2 { 3 CMenu menu; 4 menu.LoadMenu(IDR_MENU); 5 6 CMenu * pop=menu.GetSubMenu(0) ;//0为索引号 7 8 POINT ptMouse; 9 GetCurSorPost(ptMouse);10 pop->TrackPopupMenu(TPM_LEFTALIGN |. 阅读全文
posted @ 2013-11-01 15:29 尽子轨 阅读(272) 评论(0) 推荐(0) 编辑
摘要: 如上图,二分法查找,查找的过程是先确定待查找数的范围区间,然后逐步缩小查找范围,直到找到或找不到为止。c++代码的实现 1 #include 2 using namespace std; 3 const int len=10; 4 int find_array(int a[],int len,int key); 5 int full_array(int a[],int len); 6 int main() 7 { 8 int i_array[len]; 9 full_array(i_array,len);10 cout>key;13 num=find_array... 阅读全文
posted @ 2013-11-01 15:16 尽子轨 阅读(647) 评论(0) 推荐(0) 编辑