
C++
dongguojun
这个作者很懒,什么都没留下…
展开
-
函数指针
函数指针是指向函数的指针变量。 因而“函数指针”本身首先应是指针变量,只不过该指针变量指向函数。这正如用指针变量可指向整型变量、字符型、数组一样,这里是指向函数。如前所述,C在编译时,每一个函数都有一个入口地址,该入口地址就是函数指针所指向的地址。有了指向函数的指针变量后,可用该指针变量调用函数,就如同用指针变量可引用其他类型变量一样,在这些概念上是一致的。函数指针有两个用途:调用函数和做...原创 2011-02-16 17:19:02 · 108 阅读 · 0 评论 -
单链表
[code="c++"]#include #include #include using namespace std;typedef struct node{ int index; struct node* next;}ListNode;typedef ListNode *LinkList;LinkList head;LinkList p; ...原创 2011-02-16 17:19:25 · 103 阅读 · 0 评论 -
C++静态联编、动态联编
静态联编是在编译阶段进行绑定,例如重载函数(同一类体内的同名重载函数),运算符重载,都属于静态联编;动态联编是在运行阶段绑定的,在派生类继承基类的访问方式不受影响下,在继承层级关系中的同名函数,在基类中定义为虚函数时,可实现动态联编。 虚函数为非静态成员函数。 如果同名函数是虚函数,基类指针指向派生类对象时,调用的是派生类的同名函数,否则基类指针访问基类同名函数,派生类...原创 2011-02-16 17:19:37 · 264 阅读 · 0 评论 -
C++输入年月日,输出第二天是什么
输入年月日,输出第二天是什么[code="c++"]#include #include struct date{ int year,month,day;};int is_leap_year(struct date *pd){ int flag=0; if ((pd->year%4==0&&pd->year%100!=0)||pd->year%400==0)...原创 2011-02-16 17:19:47 · 2942 阅读 · 1 评论 -
线程互斥共享资源
[code="c++"]#include #include DWORD WINAPI ThreadProc1(LPVOID lpParameter);DWORD WINAPI ThreadProc2(LPVOID lpParameter);int tickets=100;HANDLE hMutex;void main(){ HANDLE handle1; HA...原创 2011-02-16 17:35:24 · 249 阅读 · 0 评论 -
指针函数
[code="c++"]#include static float score[][4]={{60,70,80,90},{56,89,34,45},{34,23,56,45}}; void main(){ float *find(float (*pointer)[4], int n); int m; cin>>m; float *p; p=find(score,...原创 2011-02-16 17:35:57 · 111 阅读 · 0 评论 -
基于对话框的聊天框
1.引入AfxSocketInit()进行Socket版本协商函数所需头文件,#include ,放在Header Files的StdAfx.h中。[img]http://dl.iteye.com/upload/attachment/380435/b845b808-7244-3560-90df-371b3c67ee3e.jpg[/img]2.在WinApp中加载套接字库...原创 2011-02-16 17:36:13 · 149 阅读 · 0 评论