摘要: 发送方:/* * File: main.c* Author: tianshuai** Created on 2011年11月29日, 下午10:34** 主要实现:发送20个文本消息,然后再发送一个终止消息*/#include <stdio.h>#include <stdlib.h>#include <string.h>#include <sys/socket.h>#include <netinet/in.h>#include <arpa/inet.h>#include <netdb.h>int port=67 阅读全文
posted @ 2011-11-30 15:33 MXi4oyu 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 本文主要是,简单实现tcp连接的两个程序。本文编写,假设读者有socket 编程思想。熟悉C编程。服务端:#include <stdio.h>#include <stdlib.h>#include <sys/socket.h>#include <netinet/in.h> //互联网地址族#include <arpa/inet.h>#include <netdb.h>#include <ctype.h> //toupper (小写转化为大写)int port =8000;/*服务端*/int main(int 阅读全文
posted @ 2011-11-30 15:32 MXi4oyu 阅读(95) 评论(0) 推荐(0) 编辑
摘要: 1.把二元查找树转变成排序的双向链表题目:输入一棵二元查找树,将该二元查找树转换成一个排序的双向链表。要求不能创建任何新的结点,只调整指针的指向。 10 / \ 6 14/ \ / \4 8 12 16转换成双向链表4=6=8=10=12=14=16。首先我们定义的二元查找树 节点的数据结构如下:struct BSTreeNode{ int m_nValue; // value of node BSTreeNode *m_pLeft; // left child of node BSTreeNode *m_pRight; // right child of node};#include... 阅读全文
posted @ 2011-11-30 00:20 MXi4oyu 阅读(125) 评论(0) 推荐(0) 编辑