csapp 2.11
来源:互联网 发布:linux下输入ftp命令 编辑:程序博客网 时间:2024/06/08 09:44
将一个数组中的元素头尾两端依次对调:
void inplase_swap(int *x,int *y){ *y=*x^*y; *x=*x^*y; *y=*x^*y;}void reverse_array(int a[],int cut){ int first,last; for(first = 0,last = cut-1; first <= last; first++,last--) inplase_swap(&a[first],&a[last]);}
当一个长度为奇数的数组时,它就会把中间元素设置为0.
修改
void reverse_array(int a[],int cut){ int first,last; for(first = 0,last = cut-1; first < last; first++,last--) inplase_swap(&a[first],&a[last]);}
阅读全文
0 0
- csapp 2.11
- CSAPP
- csapp中csapp.h和csapp.c
- csapp.h
- csapp “链接”
- csapp perflab
- CSAPP笔记
- CSAPP學習筆記
- csapp:lab2
- CSAPP bomblab
- 《CSAPP》链接
- csapp - lab1
- csapp - lab2
- CSAPP Lab2
- 读书笔记:CSAPP
- CSAPP笔记
- csapp 第一章
- CSAPP 前言
- 第二周第一节课
- 写几个windows文本处理方面的脚本
- HDU
- 二、极大似然估计
- (三)整合spring cloud云服务架构
- csapp 2.11
- L2L vpn原理及配置方法
- 文章标题
- 关于spring boot 中App类位置不同导致出错的问题的解决方法
- 安卓android的sdk安装路径和方法
- Codeforces Round #295 (Div. 1) C. Pluses everywhere
- 社区新版首页上线,开启找bug模式
- hdu3294-Girls' research
- 我在React Native开发中遇到的一些坑