摘要: #include <stdio.h> int add(int a,int b){ return a+b;} int main(){ int (*p)(int,int)=add; //函数指针的运用 int z=0; z=(*p)(2,77); printf("%d",z); return 0;} 得 阅读全文
posted @ 2023-07-05 15:41 高昱宁 阅读(9) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> int main(){ int arr[3][3]={{1,2,3},{4,5,6},{7,8,9}}; int (*p)[3]=arr; int i=0; for(i=0;i<3;i++){ int j=0; for(j=0;j<3;j++){ printf( 阅读全文
posted @ 2023-07-04 17:59 高昱宁 阅读(26) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> int main(){ char i=128; printf("%d",i+1); return 0;} 结果: 10000000 --128 10000001 --补码+1 精度升级 11111111111111111111111110000001 -补码11 阅读全文
posted @ 2023-06-28 17:06 高昱宁 阅读(17) 评论(0) 推荐(0) 编辑
摘要: /* printf example */#include <stdio.h> char* my_strcpy(char* des,const char* src){ char *ret=des; while(*src!='\0'){ *des++=*src++; } *des=*src; retur 阅读全文
posted @ 2023-06-21 15:00 高昱宁 阅读(8) 评论(0) 推荐(0) 编辑
摘要: /* printf example */#include <stdio.h> int count_one(int n){ int count=0; while(n){ n=n&(n-1); count++; } return count;} int main(){ int a=-1; printf( 阅读全文
posted @ 2023-06-16 14:04 高昱宁 阅读(5) 评论(0) 推荐(0) 编辑
摘要: declare n number:=15; count1 int :=0;begin while n<>0 loop n := bitand(n,n-1); count1 := count1+1; end loop; dbms_output.put_line(count1); end; 结果为: 对 阅读全文
posted @ 2023-06-16 13:49 高昱宁 阅读(11) 评论(0) 推荐(0) 编辑
摘要: /* printf example */#include <stdio.h> int main(){ int a=10; int b =3; int c=30; int * arr[]={&a,&b,&c}; int i=0; for(i=0;i<3;i++){ printf("%d\n", *ar 阅读全文
posted @ 2023-06-15 14:58 高昱宁 阅读(7) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> int main(){ int arr[10]={1,2,3,4,5,6,7,8,9,10}; int* p=arr; int i=0; for(i=0;i<10;i++){ printf("%d",*(p+i)); } return 0;} 阅读全文
posted @ 2023-06-14 11:00 高昱宁 阅读(23) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> void bubble_sort(int* arr,int len){ int i=0; for(i=0;i<len;i++){ int j = 0; for(j=0;j<len-i-1;j++){ if (arr[j]>arr[j+1]){ int tmp=0 阅读全文
posted @ 2023-06-01 16:45 高昱宁 阅读(27) 评论(1) 推荐(0) 编辑
摘要: #include <stdio.h> int fac(int n){ int result=1; if(n>1){ result*=n*fac(n-1); } return result; } int main(){ printf( "%d",fac(4)); } 阅读全文
posted @ 2023-05-31 16:36 高昱宁 阅读(12) 评论(0) 推荐(0) 编辑
点击右上角即可分享
微信分享提示