
c练手项目
doudou215960
男儿至死心如铁
展开
-
windows下C语言实现TCP通信
编译器:vs2017语言:c语言具体的原理可以在其他博客看到。在我学习winsock编程时,发现那些博客代码居然在我机器上没一个能运行,可能是我水平有限。于是我根据winsock相关知识,自己动手实现了一个,亲测能用,以下是代码。服务器端#include<stdio.h>#include<Winsock2.h>#include<time.h>...原创 2019-02-27 20:47:15 · 8300 阅读 · 14 评论 -
C语言实现归并排序
void merge(int *nums,int low,int mid,int high){ int i=low; int j=mid+1; int index=0; int *temp=malloc(sizeof(int)*(high-low+1)); while(i<=mid&&j<=high) { ...原创 2019-04-15 21:32:12 · 288 阅读 · 0 评论 -
C语言实现二叉树层次遍历
struct TreeNode { int val; struct TreeNode *left; struct TreeNode *right;};struct Queue { struct TreeNode *t; int rear; int front;};void InitQueue(struct Queue *q){...原创 2019-04-19 10:59:00 · 3708 阅读 · 0 评论 -
二维数组排序
void sort(int **arr,int row,int col){ int i,j,min; int *temp=NULL; for(i=0;i<row-1;i++){ min=i; for(j=i+1;j<row;j++){ if(arr[j][0]<arr[min][0]) ...原创 2019-05-14 11:50:20 · 141 阅读 · 0 评论