
c
Changhuan_1010
这个作者很懒,什么都没留下…
展开
-
指针的基本用法
地址->内存字节单元的编号: 逻辑地址:虚拟地址 物理地址:程序运行时所占物理内存为地址 指针:用于存放地址的变量,是无符号整型; 指针的类型:指针所指的变量的类型; int a[4]; int*pt; pt=a; a为指针常量 指针的运算 *pt——>通过指针指向变量的内容 pt——>&变量;&求地址 #include<stdio.h> int main(){ int a,*pta; float b; float *ptb; pta=&原创 2021-05-28 15:03:41 · 5258 阅读 · 1 评论 -
C插入排序、数组的部分注意内容
插入排序 void InsertSort(int n,int *a) { for(int i=1;i<n;i++) { if(a[i]<a[i-1]) { int j=i-1; int x=a[i]; while(j>=0&&x<a[j]) { a[j+1]=a[j]; j--; } a[j+1]=x; } } } 数组的长度与定义方式有关 char a[]="I love you"; char原创 2021-05-11 20:20:37 · 118 阅读 · 0 评论