长风破浪会有时,直挂云帆济沧海

Dream Word

博客园 首页 新随笔 联系 订阅 管理

2017年3月4日 #

摘要: /****/ //求两个int值得最大值 inline int const& max(int const& a,int const& b) { return a<b?b:a; } //求两个任意类型值中的最大值 template <typename T> inline T const& max(T 阅读全文
posted @ 2017-03-04 18:33 长风II 阅读(371) 评论(0) 推荐(0) 编辑

摘要: //file max.hpp template <typename T> //template<class T> inline T const& max (T const& a,T const& b) { return a<b?b:a; } //file max.cpp #include <iost 阅读全文
posted @ 2017-03-04 18:08 长风II 阅读(237) 评论(0) 推荐(0) 编辑

摘要: 1:check version gcc -v / g++ -v 2:compile gcc *.c / g++ *.cpp outfile: a.out 3:excute ./a.out 4:show excute time time ./a.out 5:change the after compi 阅读全文
posted @ 2017-03-04 17:40 长风II 阅读(169) 评论(0) 推荐(0) 编辑

摘要: int p; int *p; int p[3]; int *p[3];分析方式:首先从P开始分析,先与[]结合因为其优先级比*高,所以p是一个数组,然后再与*结合,说明数组里的元素是指针类型,然后再与int结合,说明指针所指向的内容的类型是整形的,所以P是一个由返回整形数据的指针所组成的数组。 in 阅读全文
posted @ 2017-03-04 16:45 长风II 阅读(136) 评论(0) 推荐(0) 编辑