- 博客(5)
- 收藏
- 关注
原创 c语言二分法
#include<stdio.h>#define M 10/*宏定义*/int main(){ int a[M]={-12,0,6,16,23,56,80,100,110,115}; int found,low,mid,high; low=0; high=M-1; printf("intput you want to found number:\n"); scanf("%d",&found); while(low<...
2022-05-27 21:38:43
87
原创 c语言,字符相关程序
1:字符串首字母从大到小排序:#include<stdio.h>#include<string.h>int sort(char *name[],int n);int print(char *name[],int n);int main(){ char *name[] ={"Fasd.com","www.asdasd.com","home.qwew.com","Fvfd.com/dz"}; int n=4; sort(name...
2022-05-26 22:12:34
151
1
原创 c语言二维数组作函数参数时的相关应用
1:二维数组为形参时常用形式:eg:arr(int*(p)[])::实参为(arr)arr(p[][]);arr(*p)::为一重指针时,实参为(*arr),也就是成为一连串一维数组2:动态开辟二维数组:eg:形参为(in**)a,只能把二维数组看成一串一维数组应用方式:*((int *)p+n*i+j)开辟方法:int **p;p = (int **)malloc(sizeof(int*)*m);p[i] = (int *)malloc(sizeof(int)*m)
2022-05-24 23:01:30
115
原创 c语言动态链表的构建
1:头文件:#include<stdio.h>#include<stdlib.h>#include<malloc.h>2:搭建链表:struct student *creat(){ struct student *head; struct student *p1,*p2; n=0; p1=p2=(struct student *)malloc(LEN); printf("ple...
2022-05-24 18:17:23
279
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人